Changeset 2815 for GTP/trunk


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

shader nice but lights dull

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r2814 r2815  
    576576        glGenRenderbuffersEXT(1, &depthBuffer);  
    577577        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuffer); 
    578         glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, texWidth, texHeight); 
     578        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, texWidth, texHeight); 
    579579        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer); 
    580580 
     
    821821        glLightfv(GL_LIGHT0, GL_POSITION, position); 
    822822 
    823         GLfloat position1[] = {bvh->GetBox().Center().x, bvh->GetBox().Max().y, bvh->GetBox().Center().z, 1.0f}; 
     823        GLfloat position1[] = {bvh->GetBox().Center().x, bvh->GetBox().Center().y, bvh->GetBox().Max().z, 1.0f}; 
    824824        glLightfv(GL_LIGHT1, GL_POSITION, position1); 
    825825} 
  • 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.