Changeset 2417


Ignore:
Timestamp:
06/06/07 19:19:29 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media
Files:
5 added
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSarm.material

    r2414 r2417  
     1vertex_program FPSArmSkinning_VP cg 
     2{ 
     3  source SkinningVS.cg 
     4  entry_point FPSArmSkinning_VP 
     5   profiles vs_2_0 
     6   includes_skeletal_animation true 
     7} 
     8 
     9vertex_program FPSArmSkinning_SMGen_VP cg 
     10{ 
     11  source SkinningVS.cg 
     12  entry_point FPSArmSkinning_SMGen_VP 
     13  profiles vs_2_0 
     14  includes_skeletal_animation true 
     15} 
     16 
     17fragment_program FPSArm_PS hlsl 
     18{ 
     19   source FPSArm_PS.hlsl 
     20   entry_point FPSArm_PS 
     21   target ps_2_0 
     22} 
     23 
     24material FPSArmShadowMapGen_POINT 
     25{ 
     26        technique 
     27        { 
     28                pass 
     29                { 
     30                        vertex_program_ref FPSArmSkinning_SMGen_VP  
     31                        { 
     32                                param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4 
     33                                param_named_auto viewProjectionMatrix viewproj_matrix 
     34                                param_named_auto viewMatrix view_matrix                          
     35                        } 
     36                  fragment_program_ref GTP/Basic/CDistNorm_PS 
     37                   {     
     38                    param_named_auto farPlane far_clip_distance 
     39                   }   
     40                } 
     41        } 
     42} 
     43 
     44material FPSArmCameraDepth 
     45{ 
     46        technique 
     47        { 
     48                pass 
     49                { 
     50                        vertex_program_ref FPSArmSkinning_SMGen_VP  
     51                        { 
     52                                param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4 
     53                                param_named_auto viewProjectionMatrix viewproj_matrix 
     54                                param_named_auto viewMatrix view_matrix                          
     55                        }                    
     56                        fragment_program_ref GTP/Basic/CDepth_PS 
     57                    { 
     58                        param_named_auto farplane far_clip_distance 
     59                    }   
     60                } 
     61        } 
     62} 
     63 
    164material phong3 
    265{ 
     
    568                pass mainpass 
    669                { 
    7                         depth_write on 
    870                        cull_hardware none 
    9                          
    10                         vertex_program_ref GTP/Basic/ShadedTex_VS 
    11                         { 
    12                                 param_named_auto WorldViewProj worldviewproj_matrix 
    13                                 param_named_auto World world_matrix 
    14                                 param_named_auto WorldInv inverse_world_matrix 
    15                         } 
    16                         fragment_program_ref GTP/Basic/Shaded/TexturedTwoLights_PS 
    17                         { 
    18                                 param_named_auto lightPos1 light_position 0 
    19                                 param_named_auto lightDir1 light_direction 0 
    20                                 param_named_auto lightColor1 light_diffuse_colour 0 
    21                                 param_named_auto lightPower1 light_power 0 
    22                                  
    23                                 param_named_auto lightPos2 light_position 1 
    24                                 param_named_auto lightDir2 light_direction 1 
    25                                 param_named_auto lightColor2 light_diffuse_colour 1 
    26                                 param_named_auto lightPower2 light_power 1 
    27                         } 
    28          
     71                        IllumTechniques 
     72                        { 
     73                                RenderTechnique Triggers 
     74                                { 
     75                                        ILLUM_TRIGGER_SM_POINT FPSArmShadowMapGen_POINT 
     76                                        ILLUM_TRIGGER_CAMERADEPTH FPSArmCameraDepth 
     77                                } 
     78                        } 
     79                        vertex_program_ref FPSArmSkinning_VP  
     80                        { 
     81                            param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4 
     82                            param_named_auto viewProjectionMatrix viewproj_matrix 
     83                            param_named_auto lightPos light_position 0 
     84                            param_named_auto cameraPos camera_position           
     85                        } 
     86                        fragment_program_ref FPSArm_PS  
     87                        { 
     88                            param_named_auto lightRange light_attenuation 0 
     89                            param_named_auto lightPower light_power 0 
     90                            param_named_auto lightColor light_diffuse_colour 0 
     91                            param_named specularity float 100 
     92                            param_named albedo float 0.1 
     93                            param_named specularColor float4 0 0 0 0                     
     94                        } 
    2995                        texture_unit basetexture 
    3096                        { 
    31                                 texture colortex.png                             
    32                         } 
    33                 } 
    34         } 
    35 } 
     97                            texture FPSArmColor2.png 
     98                        } 
     99                        texture_unit bumptexture 
     100                        { 
     101                            texture FPSArmNormal.png 
     102                        } 
     103                } 
     104        } 
     105} 
     106 
    36107 
    37108vertex_program GTP/MoriaDemo/Sword_VS hlsl 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/MoriaHallBase.hlsl

    r2404 r2417  
    129129        //do Path Map to gather indirect illumination 
    130130         
    131 //      float4 indirect = PathMapIndirect(PathMap, WeightIndexMap, WeightMap, IN.texCoord2.zw) * 1.2; 
    132 //      indirect *= diffuseColor; 
    133 //      Color = Color + indirect; 
     131        //float4 indirect = PathMapIndirect(PathMap, WeightIndexMap, WeightMap, IN.texCoord2.zw) * 1.2; 
     132        //indirect *= diffuseColor; 
     133        //Color = Color + indirect; 
     134         
     135        Color += lightPower1 * diffuseColor * 0.0005; 
    134136         
    135137        //gather caustics for all casters 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/illum.hlsl

    r2404 r2417  
    7979                float3 weight = tex2D(weightTex, float2((weightIndex + 0.5)/allClusterCount, 0.5)).rgb; 
    8080                float3 val = tex2D(PMTex, prmTexPos).xyz; 
    81                 if(length(val - float3(1,1,1))== 0) 
    82                 val = 0; 
     81        //      if(length(val - float3(1,1,1))== 0) 
     82        //      val = 0; 
    8383                col += val.xyz * weight;                 
    8484        } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.material

    r2398 r2417  
    2323                                //RenderTechnique PathMap 
    2424                                //{ 
    25                             //  new_passes false 
     25                                //      pass_blending one zero 
     26                           //   new_passes false 
    2627                                //      start_tex_id 3 
    2728                                //}      
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/troll.material

    r2414 r2417  
    11vertex_program TrollSkinningOneWeight cg 
    22{ 
    3    source trollvs.cg 
     3   source SkinningVS.cg 
    44   entry_point trollSkinning_One_Weight_vp 
    55   profiles vs_2_0 
     
    99vertex_program TrollSkinningSMGen cg 
    1010{ 
    11    source trollvs.cg 
     11   source SkinningVS.cg 
    1212   entry_point trollSkinning_SMGen_One_Weight_vp 
    1313   profiles vs_2_0 
     
    8989                            param_named_auto lightPower light_power 0 
    9090                            param_named_auto lightColor light_diffuse_colour 0 
    91                             param_named specularity float 1 
    92                             param_named specularColor float4 0.02 0.02 0.02 0.02                         
     91                            param_named specularity float 200 
     92                            param_named albedo float 0.1 
     93                            param_named specularColor float4 0.0016 0.0015 0.001 0                       
    9394                        } 
    9495                        texture_unit basetexture 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollps.hlsl

    r2398 r2417  
    1515 
    1616uniform float specularity; 
     17uniform float albedo; 
    1718uniform float4 specularColor; 
    1819 
     
    3738        float3 L = IN.L; 
    3839         
    39         float4 diffuseColor = tex2D(colorTexture, IN.texCoord); 
     40        float4 diffuseColor = albedo * tex2D(colorTexture, IN.texCoord); 
    4041         
    4142        Color = Illumination(N, L, V, lightColor * lightPower, lightRange, diffuseColor, specularity, specularColor); 
    4243         
    43         float4 ret =  diffuseColor * 0.1 + Color; 
     44        float4 ret =  Color; 
    4445        return float4(ret.xyz, dist); 
    4546} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMap.material

    r2403 r2417  
    166166        {   
    167167                filtering none    
     168                texture MainLightPM_WEIGHT_MAP_ALL 
     169        } 
     170        texture_unit 
     171        { 
     172                filtering none    
     173                texture MainLightPM_WEIGHT_MAP 
    168174        } 
    169175   } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMapWeightCompute.hlsl

    r2409 r2417  
    3232    vsOutputComputeWeights output = (vsOutputComputeWeights)0; 
    3333    output.pos = input.pos; 
    34     output.tex = (input.pos + 1.0) / 2.0; 
     34    output.tex = (input.pos.xy + 1.0) / 2.0; 
    3535    //output.tex = input.tex; 
    36    // output.tex.y = 1.0 - output.tex.y; 
    37     input.pos.y *= -1; 
     36    output.tex.y = 1.0 - output.tex.y; 
     37    //input.pos.y *= -1; 
    3838    
    3939    return output; 
     
    9595{ 
    9696        float dataColumnWidth = 1.0 / (float)nRadionColumns; 
    97         int bushIndex = input.tex.x * 4096 + input.tex.y * nRadionColumns * 4096; 
     97/*      int bushIndex = input.tex.x * 4096 + input.tex.y * nRadionColumns * 4096; 
    9898        int werx = bushIndex % nRadionColumns; 
    9999        int wery = bushIndex / nRadionColumns; 
    100100        float3 pos = tex2D(radionSampler, float2((werx + 0.25) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz; 
    101         float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz; 
     101        float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz;*/ 
     102        float3 pos = tex2D(radionSampler, float2(input.tex.x + 0.25 * dataColumnWidth, input.tex.y  + 0.5 / 4096.0) ).xyz; 
     103        float3 dir = tex2D(radionSampler, float2(input.tex.x + 0.75 * dataColumnWidth, input.tex.y  + 0.5 / 4096.0) ).xyz; 
     104//      float3 pos = tex2D(radionSampler, float2(0.25, input.tex.y  + 0.5 / 4096.0) ).xyz; 
     105//      float3 dir = tex2D(radionSampler, float2(0.75, input.tex.y  + 0.5 / 4096.0) ).xyz; 
     106         
    102107        dir = normalize(dir); 
    103108         
     
    115120        dist -= DIST_BIAS; 
    116121        visibility = (distNorm <= storedDist); 
    117            
    118         visibility = 1.0 + 0.00001 * visibility;                 
     122        //visibility = visibility * 0.0000001 + 1.0;   
    119123        visibility *=  1.0 / (lightAttenuation.y + dist * lightAttenuation.z + dist * dist * lightAttenuation.w); 
    120124         
    121125        float4 ret = visibility * cosb * lightPower * lightColor; 
     126         
     127        //ret = 0.00000001 * ret * nRadionColumns + (dist<25.0);//float4(pos,1);//input.tex.y * 4096.0; 
    122128        return ret; 
    123129} 
     
    137143        for(int i = 0; i < entryPointCount; i++) 
    138144        { 
    139                  
    140145                float dataColumnWidth = 1.0 / (float)nRadionColumns; 
    141146                int werx = currentEntryPoint % nRadionColumns; 
    142147                int wery = currentEntryPoint / nRadionColumns; 
    143                 float2 coord1 = float2((werx + 0.5) * dataColumnWidth, (wery  + 0.5) / 4096.0); 
     148                float2 coord1 = float2((werx + 0.5) * dataColumnWidth, (wery  + 0.5) / 4096.0);          
    144149                float2 coord2 = coord1 + float2(0.25 * dataColumnWidth, 0); 
     150                 
     151                //coord1 = coord1 * 0.00000001 + float2(0.5, (currentEntryPoint + 0.5)/4096); 
     152                //coord2 = coord1 + float2(0.25, 0); 
     153                 
    145154                float3 w = tex2Dlod(allWeightsSampler, float4(coord1, 0, 0)).rgb; 
    146                 float radrad = tex2Dlod(radionSampler, float4(coord2, 0, 0)).a;          
     155                float radrad = 1;// tex2Dlod(radionSampler, float4(coord2, 0, 0)).a;             
    147156                weight += w * radrad;            
    148157                clusterRad += radrad; 
     
    155164                weight = 0; 
    156165    
    157         return float4(weight, 1); 
     166        float4 ret = 0; 
     167        //if(abs(input.tex.x - 2*halfPixel*2)<halfPixel/2.0) 
     168                ret = float4(weight, 1);         
     169        return ret; 
    158170} 
    159171 
     
    162174                                                 uniform float4x4 worldViewProj, 
    163175                                                 out float4 hPos:POSITION, 
    164                                                  out float2 texCoord: TEXCOORD0) 
     176                                                 out float3 texCoord: TEXCOORD0) 
    165177{ 
    166         hPos = mul(worldViewProj, position); 
    167         texCoord = color.xy; 
     178        hPos = mul(worldViewProj, float4(position.x,0,position.z,1)); 
     179        texCoord = color.xyz; 
     180        texCoord = position.y; 
    168181} 
    169182 
    170 float4 EntryPointDisplayPS(float2 texCoord : TEXCOORD0, 
    171                                                         uniform sampler2D weightTexture : register(s0)):COLOR0 
     183float4 EntryPointDisplayPS(float3 texCoord : TEXCOORD0, 
     184                                                        uniform sampler2D weightTexture : register(s0), 
     185                                                        uniform sampler2D clusterWeightTexture : register(s1)):COLOR0 
    172186{ 
    173         //return texCoord.y; 
    174         return texCoord.r; 
     187        float entryPointID = (256.0f * texCoord.r * 256.0f + 256.0f * texCoord.g + 0.5) / 4096.0f; 
     188        entryPointID = texCoord.x; 
     189        //return float4(texCoord, 1); 
     190        //return tex2D(clusterWeightTexture, float2(0.5, 1.0 - ((entryPointID + 0.5 )/ 4096.0))); 
     191        return tex2D(weightTexture, float2(0.5, ((entryPointID + 0.5 )/ 4096.0))); 
     192        //return abs(tex2D(weightTexture, float2(0.5, ((entryPointID + 0.5 )/ 4096.0))) - entryPointID); 
     193        return entryPointID; 
    175194} 
    176195                                                          
Note: See TracChangeset for help on using the changeset viewer.