Ignore:
Timestamp:
07/04/08 03:38:22 (16 years ago)
Author:
mattausch
Message:

shader nice but lights dull

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r2814 r2815  
    7070  // the normal on the current position 
    7171  float3 centerNormal = tex2D(normals, IN.texCoord.xy).xyz; 
    72   normalize(centerNormal); 
     72  //normalize(centerNormal); 
    7373   
    7474  // Check in a circular area around the current position. 
     
    8181  const float areaSize = 5e-1f; 
    8282  //const float areaSize = 1e-4f; 
    83   const float sampleIntensity = 0.2f; 
     83  const float sampleIntensity = 0.1f; 
    8484   
    8585  for (int i = 0; i < SAMPLES; i ++) { 
     
    130130{ 
    131131  pixel OUT; 
    132   float4 lightDir = float4(1.0f, 1.0f, 1.0f, 0.0f); 
    133   //float4 lightDir = float4(0.0f, 1.0f, 0.0f, 0.0f); 
     132 
     133  float4 lightDir = float4(0.8f, 1.0f, 1.5f, 0.0f); 
     134  float4 lightDir2 = float4(-0.5f, 0.5f, 0.4f, 0.0f); 
    134135   
    135136  float4 color = tex2D(colors, IN.texCoord.xy); 
    136137  float3 normal = tex2D(normals, IN.texCoord.xy).xyz; 
     138 
    137139  // expand normal 
    138140  normal = normal * 2.0f - 1.0f; 
     
    144146  // float3 L = normalize(lightPosition - position); 
    145147  float3 light = normalize(lightDir.xyz); 
     148  float3 light2 = normalize(lightDir.xyz); 
    146149 
    147150  float diffuseLight = max(dot(normal, light), 0.0f); 
    148   float diffuse = diffuseLight; 
     151  float diffuseLight2 = max(dot(normal, light2), 0.0f); 
     152 
     153  float diffuse = diffuseLight + diffuseLight2; 
    149154 
    150155  float ao = ssao(IN, positions, normals, ProjTrafo, noiseTexture); 
    151   OUT.color = ao;  
    152   //OUT.color = ao * (ambient + diffuse) * color; 
     156  //OUT.color = ao;  
     157  OUT.color = ao * (ambient + diffuse) * color; 
    153158 
    154159  //float4 currentPos = tex2D(normals, IN.texCoord.xy) * 0.5f + 0.5f; 
Note: See TracChangeset for help on using the changeset viewer.