Files
PhysX4.1/physx/samples/sampleframework/media/shaders/fragment/simple_lightmap.cg
2025-11-28 23:13:44 +05:30

22 lines
746 B
Plaintext

#include <phong_lighting.cg>
#include <fragment_entry_fog.cg>
DECLARE_TEXTURE(diffuseTexture)
DECLARE_TEXTURE(lightmapTexture)
SurfaceMaterial computeSurfaceMaterial(const FragmentParameters params)
{
half4 diffuseTextureColor = (half4)tex2D(diffuseTexture, params.texcoord0.xy);
half4 lightmapTextureColor = (half4)tex2D(lightmapTexture, params.texcoord1.xy);
SurfaceMaterial mout;
mout.diffuseColor = diffuseTextureColor.rgb*lightmapTextureColor.rgb*2;
mout.alpha = diffuseTextureColor.a;
mout.emissiveColor = 0;
mout.specularColor = half3(0.2,0.2,0.2); // TODO: make this a constant parameter set by the material.
mout.specularPower = 16;
mout.tangentSpaceNormal = half3(0,0,1);
return mout;
}