Ignore:
Timestamp:
04/28/06 19:49:56 (18 years ago)
Author:
igarcia
Message:
 
Location:
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media
Files:
186 added
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_FP20.cg

    r821 r861  
    66             uniform float epsilonY, 
    77             uniform float sourceTextureSize, 
     8             uniform float numSamples, 
     9             uniform float sqrtNumSamples, 
    810             out float4 ocolor: COLOR) 
    911{ 
    1012   ocolor = float4(0.0, 0.0, 0.0, 0.0); 
    1113   float2 epsilon = float2(epsilonX, epsilonY); 
     14   float4 value = tex2D(indirectTexture, subTexCoord).xyzw; 
     15   float2 coords = float2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 
    1216 
    13    float2 coords = float2(0.0, 1.0) - abs(texCoord - ( tex2D(indirectTexture, subTexCoord).xy - epsilon ) ); 
    14  
    15    if (tex2D(indirectTexture, subTexCoord).z != 0.0)  
    16    {        
    17         ocolor = float4(tex2D(sourceTexture, coords * sourceTextureSize).xyzw); 
     17   if (value.z != 0.0)  
     18   {     
     19        float2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 
     20        ocolor = float4(tex2D(sourceTexture, newcoord).xyzw); 
    1821   } 
    1922} 
    20  
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_glsl_FP20.shd

    r821 r861  
    44uniform float epsilonY; 
    55uniform float sourceTextureSize; 
     6uniform float numSamples; 
     7uniform float sqrtNumSamples; 
    68 
    79void main(void) 
     
    1113   vec2 texCoord = gl_TexCoord[0].xy; 
    1214   vec2 subTexCoord = gl_TexCoord[1].xy;    
    13    vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( texture2D(indirectTexture, subTexCoord ).xy - epsilon ) ); 
     15   vec4 value = texture2D(indirectTexture, subTexCoord).xyzw; 
     16   vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 
    1417 
    15    if (texture2D(indirectTexture, subTexCoord).z != 0.0)  
     18   if (value.z != 0.0)  
    1619   {        
    17         ocolor = texture2D(sourceTexture, coords * sourceTextureSize).xyzw; 
     20        vec2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 
     21        ocolor = vec4(texture2D(sourceTexture, newcoord).xyzw); 
    1822   } 
    19  
    2023   gl_FragColor = ocolor;  
    2124}    
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_hlsl_FP20.shd

    r821 r861  
    55uniform float epsilonY; 
    66uniform float sourceTextureSize; 
     7uniform float numSamples; 
     8uniform float sqrtNumSamples; 
    79 
    810float4 main_fp(float2 texCoord: TEXCOORD0,  
     
    1113   float4 ocolor = float4(0.0, 0.0, 0.0, 0.0); 
    1214   float2 epsilon = float2(epsilonX, epsilonY); 
     15   float4 value = tex2D(indirectTexture, subTexCoord).xyzw; 
     16   float2 coords = float2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 
    1317 
    14    float2 coords = float2(0.0, 1.0) - abs(texCoord - ( tex2D(indirectTexture, subTexCoord).xy - epsilon ) ); 
    15  
    16    if (tex2D(indirectTexture, subTexCoord).z != 0.0)  
    17    {        
    18         ocolor = float4(tex2D(sourceTexture, coords * sourceTextureSize).xyzw); 
     18   if (value.w != 0.0)  
     19   {     
     20        float2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 
     21        ocolor = float4(tex2D(sourceTexture, newcoord).xyzw); 
    1922   } 
    2023 
    2124   return  ocolor; 
    2225} 
    23  
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingPointBasedGeneration_FP20.cg

    r786 r861  
    11void main(float4 colour: COLOR0, 
    2           uniform float textureSize, 
     2          float4 texCoord: TEXCOORD0, 
    33          out float4 ocolor: COLOR) 
    44{ 
    5         ocolor = float4(0.0, 0.0, 1.0 - (1.0/textureSize), 1.0 - (1.0/textureSize)); 
     5        ocolor = float4(0.0, 0.0, texCoord.xy); 
    66} 
Note: See TracChangeset for help on using the changeset viewer.