Ignore:
Timestamp:
09/04/08 15:00:42 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2897 r2903  
    4646                                 uniform float3 currentNormal, 
    4747                                 uniform float3 currentViewDir, 
    48                                  uniform float noiseMultiplier, 
    4948                                 uniform float4 centerPosition 
    5049                                 ) 
     
    6766        { 
    6867                float2 offset = samples[i]; 
    69                 //float3 offset = float3(samples[i], 0); 
    70  
    71                 //sample noisetex; r stores costheta, g stores sintheta 
    72                 float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy; 
    73                 //float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy, 0); 
    74  
    75                 // reflect sampling using the noise texture 
     68 
     69#if 1 
     70                //////////////////// 
     71                // add random noise: reflect around random normal vector (warning: slow!) 
     72                float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy).xy; 
    7673                float2 offsetTransformed = myreflect(offset, mynoise); 
    77  
     74#else 
     75                float2 offsetTransformed = offset; 
     76#endif 
    7877                // weight with projected coordinate to reach similar kernel size for near and far 
    7978                float2 texcoord = IN.texCoord.xy + offsetTransformed * AREA_SIZE * w; 
     
    9695 
    9796                // if normal perpenticular to view dir, only half of the samples count 
    98                 //const float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal)); 
    99                 //total_color.w -= cos_angle * distance_intensity * view_correction; 
    100                 //total_color.xyz += cos_angle * distance_intensity * view_correction * sample_color * ILLUM_INTENSITY; 
    101  
     97                /* 
     98                const float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal)); 
     99                total_color.w -= cos_angle * distance_intensity * view_correction; 
     100                total_color.xyz += cos_angle * distance_intensity * view_correction * sample_color * ILLUM_INTENSITY; 
     101                */ 
    102102                total_color.w -= cos_angle * distance_intensity; 
    103103                total_color.xyz += cos_angle * distance_intensity * sample_color * ILLUM_INTENSITY; 
     
    116116                   uniform sampler2D noiseTexture, 
    117117                   uniform float2 samples[NUM_SAMPLES], 
    118                    uniform float noiseMultiplier, 
    119118                   uniform sampler2D oldSsaoTex, 
    120119                   uniform sampler2D oldIllumTex, 
     
    146145 
    147146        float4 new_color = globIllum(IN, colors, positions, noiseTexture,  
    148                                  samples, normal, viewDir, noiseMultiplier, centerPosition); 
     147                                 samples, normal, viewDir, centerPosition); 
    149148         
    150149 
Note: See TracChangeset for help on using the changeset viewer.