Changeset 2337


Ignore:
Timestamp:
04/24/07 14:10:34 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media
Files:
7 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/PMDemo/PRMDemo.material

    r2284 r2337  
    1 vertex_program GTP/PathMap_VS hlsl 
    2 { 
    3    source PathMap.hlsl 
    4    entry_point vsWalk 
    5    target vs_2_0    
    6 } 
    7  
    8 fragment_program GTP/PathMap_PS hlsl 
    9 { 
    10    source PathMap.hlsl 
    11    entry_point psWalk 
    12    target ps_3_0 
    13    flow_control prefer 
    14 } 
    15  
    161material PRMDemo/Base 
    172{ 
     
    131116  } 
    132117} 
    133  
    134  
    135 vertex_program GTP/PathMap_ComputeWeights_VS hlsl 
    136 { 
    137    source PathMapWeightCompute.hlsl 
    138    entry_point vsComputeWeights 
    139    target vs_2_0    
    140 } 
    141  
    142 fragment_program GTP/PathMap_ComputeWeights_PS hlsl 
    143 { 
    144    source PathMapWeightCompute.hlsl 
    145    entry_point psComputeWeights 
    146    target ps_3_0    
    147 } 
    148  
    149 material GTP/PathMap_ComputeWeights 
    150 { 
    151         technique 
    152         { 
    153                 pass 
    154                 { 
    155                         depth_check off 
    156                         cull_harware none 
    157                         vertex_program_ref GTP/PathMap_ComputeWeights_VS 
    158                         { 
    159                                  
    160                         } 
    161                         fragment_program_ref GTP/PathMap_ComputeWeights_PS 
    162                         { 
    163                         } 
    164                         texture_unit //entrypoint texture 
    165                         { 
    166                                 filtering off 
    167                         } 
    168                         texture_unit shadow_map //stores distances 
    169                         { 
    170                          
    171                 } 
    172                 } 
    173                  
    174         } 
    175 } 
    176  
    177 fragment_program GTP/PathMap_SumWeights_PS hlsl 
    178 { 
    179    source PathMapWeightCompute.hlsl 
    180    entry_point psSumWeights 
    181    target ps_3_0 
    182    flow_control prefer      
    183 } 
    184  
    185 material GTP/PathMap_SumWeights 
    186 { 
    187         technique 
    188         { 
    189                 pass 
    190                 { 
    191                          
    192                         depth_check off 
    193                         cull_harware none 
    194                         lighting off 
    195                         vertex_program_ref GTP/PathMap_ComputeWeights_VS 
    196                         { 
    197                                  
    198                         } 
    199                         fragment_program_ref GTP/PathMap_SumWeights_PS 
    200                         { 
    201                         } 
    202                         texture_unit //entrypoint texture 
    203                         { 
    204                                 filtering none 
    205                         } 
    206                         texture_unit //entrypoint weight texture 
    207                         { 
    208                                 filtering none 
    209                         } 
    210                         texture_unit //cluster length 
    211                         { 
    212                                 filtering none 
    213                         } 
    214                 } 
    215                  
    216         } 
    217 } 
    218  
    219 vertex_program GTP/EPDisplayVS hlsl 
    220 { 
    221    source PathMapWeightCompute.hlsl 
    222    entry_point EntryPointDisplayVS 
    223    target vs_2_0    
    224 } 
    225 fragment_program GTP/EPDisplayPS hlsl 
    226 { 
    227    source PathMapWeightCompute.hlsl 
    228    entry_point EntryPointDisplayPS 
    229    target ps_2_0    
    230 } 
    231  
    232 material GTP/PM/EPBillboards 
    233 { 
    234  technique 
    235  { 
    236    pass 
    237    { 
    238                 polygon_mode points 
    239                 point_size 10 
    240                 vertex_program_ref GTP/EPDisplayVS 
    241                 { 
    242                         param_named_auto worldViewProj worldviewproj_matrix      
    243                 } 
    244                 fragment_program_ref GTP/EPDisplayPS 
    245                 { 
    246                 } 
    247         texture_unit 
    248         {   
    249                 filtering none    
    250         } 
    251    } 
    252   } 
    253 } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/diffuse/GTPDiffuse.hlsl

    r2054 r2337  
    66float4 readCubeMap(samplerCUBE cm, float3 coord)                 
    77{ 
    8         float4 color = texCUBElod( cm, float4(coord.xy, -coord.z, 1) ); 
     8        float4 color = texCUBElod( cm, float4(coord.xy, -coord.z, 0) ); 
    99        color.a = 1; 
    1010        return color; 
     
    1313float readDistanceCubeMap(samplerCUBE dcm, float3 coord)                 
    1414{ 
    15         float dist = texCUBElod(dcm, float4(coord.xy, - coord.z, 1)).r; 
     15        float dist = texCUBElod(dcm, float4(coord.xy, - coord.z, 0)).r; 
    1616        if(dist == 0) dist = 1000000; ///sky 
    1717        return dist; 
     
    2626 float4 MPos : TEXCOORD0; 
    2727}; 
    28  
     28/* 
    2929float4 ReduceCubeMap_PS(MPos_OUT IN, 
    3030                                                uniform int nFace, 
     
    5454        return color / (RATE * RATE);            
    5555} 
    56  
     56*/ 
     57 
     58float4 ReduceCubeMap_PS(MPos_OUT IN, 
     59                                                uniform int nFace, 
     60                                                uniform samplerCUBE EnvironmentMapSampler : register(s0) ) : COLOR 
     61 
     62   float4 color = 0; 
     63   float3 dir; 
     64   
     65   for (int i = 0; i < RATE/2; i+=1) 
     66     for (int j = 0; j < RATE/2; j+=1) 
     67    { 
     68                float2 pos; 
     69                pos.x = IN.MPos.x + (4*i + 2)/(float)CUBEMAP_SIZE; 
     70                pos.y = IN.MPos.y - (4*j + 2)/(float)CUBEMAP_SIZE;      // y=-u 
     71 
     72                // "scrambling" 
     73                if (nFace == 0) dir = float3(1, pos.y, -pos.x); 
     74                if (nFace == 1) dir = float3(-1, pos.y, pos.x); 
     75                if (nFace == 2) dir = float3(pos.x, 1, -pos.y); 
     76                if (nFace == 3) dir = float3(pos.x, -1, pos.y); 
     77                if (nFace == 4) dir = float3(pos.x, pos.y, 1); 
     78                if (nFace == 5) dir = float3(-pos.x, pos.y,-1); 
     79 
     80                color += texCUBE( EnvironmentMapSampler, dir); 
     81    } 
     82  
     83        return color / (RATE * RATE / 4.0);              
     84} 
    5785 
    5886//////////////// 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/diffuse/GTPDiffuse.program

    r2054 r2337  
    44        entry_point Diffuse_Poly2Point_PS 
    55        target ps_3_0 
    6         flow_control prefer 
     6        //flow_control prefer 
    77} 
    88 
     
    2828        entry_point ReduceCubeMap_PS 
    2929        target ps_3_0 
    30         flow_control prefer 
     30        //flow_control avoid 
    3131} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program

    r2294 r2337  
    193193   source GTPShadowMap_PS.hlsl 
    194194   entry_point shadowMapDist_Variance 
     195   target ps_2_0 
     196} 
     197 
     198fragment_program GTP/Basic/SM/Dist_POINT_VSM_PS hlsl 
     199{ 
     200   source GTPShadowMap_PS.hlsl 
     201   entry_point shadowMapDist_POINT_Variance 
    195202   target ps_2_0 
    196203} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl

    r2311 r2337  
    106106    float4 pos = (IN.LightVPos / IN.LightVPos.w); 
    107107        float d = length(pos.xy); 
    108     light = saturate((1.0 - d)/0.05);            
    109108    if(d <= 1.0) 
    110109    { 
     
    126125    } 
    127126  } 
    128   else 
    129    light = 0;    
    130127         
    131128  return shadowColor + (1 - shadowColor) * light; 
    132129} 
     130 
     131 
     132float4 shadowMapDist_POINT_Variance(LightCPos_OUT IN, 
     133                              uniform float lightFarPlane, 
     134                              uniform samplerCUBE shadowMap) : COLOR 
     135{ 
     136  float4 light = float4(1,1,1,1); 
     137   
     138  float dist = length(IN.LightCPos.xyz) / lightFarPlane; 
     139  float4 storedDist = texCUBE(shadowMap, float3(IN.LightCPos.xy, -IN.LightCPos.z)); 
     140  dist -= DIST_BIAS_VSM; 
     141  float lit_factor = light * (dist <= storedDist.r);     
     142          
     143  float M1 = storedDist.r; 
     144  float M2 = storedDist.g; 
     145  float v2 = min(max(M2 - M1 * M1, 0.0) +  DIST_EPSILON, 1.0); 
     146  float m_d = M1 - dist; 
     147  float pmax = v2 / (v2 + m_d * m_d); 
     148                                                 
     149  // Adjust the light color based on the shadow attenuation 
     150  light = max(lit_factor, pmax);         
     151         
     152   
     153  return (shadowColor + (1 - shadowColor) * light); 
     154} 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material

    r2301 r2337  
    117117                                use_triangles   true 
    118118                                blur_caustic_cubemap true                                
     119                        } 
     120                         
     121                 }       
     122         vertex_program_ref GTP/Basic/Shaded_VS 
     123         {        
     124            param_named_auto WorldViewProj worldviewproj_matrix  
     125            param_named_auto World world_matrix 
     126            param_named_auto WorldInv inverse_world_matrix 
     127         }  
     128         fragment_program_ref GTP/EnvMap/Localized_Refraction_PS 
     129         {  
     130                    param_named_auto cameraPos camera_position 
     131            param_named lastCenter float3 0 0 0 
     132            param_named sFresnel float 0.1 
     133<<<<<<< .mine 
     134            param_named sRefraction float 0.85 
     135======= 
     136            param_named sRefraction float 0.8 
     137>>>>>>> .r2314 
     138             }           
     139             //Cube map for reflections and refractions  
     140             texture_unit 
     141             { 
     142             
     143             } 
     144             //Cube map of distances 
     145             texture_unit 
     146             { 
     147                filtering none 
     148             } 
     149          } 
     150   } 
     151} 
     152 
     153material GTP/Caustic/Glass_PointSprite 
     154{ 
     155   technique  
     156   {    
     157      pass  
     158      {  
     159                 IllumTechniques 
     160                 { 
     161                        RenderTechnique ColorCubeMap 
     162                        { 
     163                                update_interval         0 
     164                                update_all_face true                                                                     
     165                        } 
     166                        RenderTechnique DistanceCubeMap 
     167                        { 
     168                                update_interval         0 
     169                                update_all_face true                                                                             
     170                        } 
     171                        RenderTechnique CausticCaster 
     172                        { 
     173                                attenuation     1000 
     174                                update_interval 1 
     175                                update_all_face true 
     176                                photonmap_resolution 64 
     177                                caustic_cubemap_resolution 256 
     178                                photon_map_material     GTP/Caustic/PhotonMap_HitEnv 
     179                                caustic_map_material    GTP/Caustic/CauCube_PointSprite 
     180                                blur_caustic_cubemap false 
    119181                        } 
    120182                         
     
    146208   } 
    147209} 
    148  
    149 material GTP/Caustic/Glass_PointSprite 
    150 { 
    151    technique  
    152    {    
    153       pass  
    154       {  
    155                  IllumTechniques 
    156                  { 
    157                         RenderTechnique ColorCubeMap 
    158                         { 
    159                                 update_interval         0 
    160                                 update_all_face true                                                                     
    161                         } 
    162                         RenderTechnique DistanceCubeMap 
    163                         { 
    164                                 update_interval         0 
    165                                 update_all_face true                                                                             
    166                         } 
    167                         RenderTechnique CausticCaster 
    168                         { 
    169                                 attenuation     1000 
    170                                 update_interval 1 
    171                                 update_all_face true 
    172                                 photonmap_resolution 64 
    173                                 caustic_cubemap_resolution 256 
    174                                 photon_map_material     GTP/Caustic/PhotonMap_HitEnv 
    175                                 caustic_map_material    GTP/Caustic/CauCube_PointSprite 
    176                                 blur_caustic_cubemap false 
    177                         } 
    178                          
    179                  }       
    180          vertex_program_ref GTP/Basic/Shaded_VS 
    181          {        
    182             param_named_auto WorldViewProj worldviewproj_matrix  
    183             param_named_auto World world_matrix 
    184             param_named_auto WorldInv inverse_world_matrix 
    185          }  
    186          fragment_program_ref GTP/EnvMap/Localized_Refraction_PS 
    187          {  
    188                     param_named_auto cameraPos camera_position 
    189             param_named lastCenter float3 0 0 0 
    190             param_named sFresnel float 0.1 
    191             param_named sRefraction float 0.8 
    192              }           
    193              //Cube map for reflections and refractions  
    194              texture_unit 
    195              { 
    196              
    197              } 
    198              //Cube map of distances 
    199              texture_unit 
    200              { 
    201                 filtering none 
    202              } 
    203           } 
    204    } 
    205 } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Phong.hlsl

    r2294 r2337  
    115115  OUT.hPos = OUT.hPosition = mul(worldViewProj, position); 
    116116  OUT.wPos = mul(worldView, position).xyz;   
    117   OUT.mNormal = mul(normal, worldViewI).xyz; 
     117  OUT.mNormal = normal;//mul(normal, worldViewI).xyz; 
    118118  //OUT.mNormal = normal; 
    119119  OUT.texCoord = texCoord;   
     
    165165         
    166166    float3 N = IN.mNormal; 
    167     //float3 N = mul(worldViewIT, IN.mNormal); 
    168167    N = normalize( N );  
    169168    float3 pos = IN.wPos; 
Note: See TracChangeset for help on using the changeset viewer.