Code: Select all
Material material;
void SetupMaterial(inout Material material)
{
vec2 texCoord = vTexCoord.st;
material.Base = getTexel(texCoord);
vec4 addEnv = texture(tex_envmap, (normalize(uCameraPos.xyz - pixelpos.xyz).xy));
material.Base = (material.Base*0.7) + (addEnv*0.3);
}
Code: Select all
material texture "DEM1_5"
{
Shader "shaders/EnvMapReflFake.gl"
texture tex_envmap "Textures/Environments/Your_Environment_Map_Name.jpg"
}
Code: Select all
material texture "Models/Floors/DEM1_5_On_My_Model.png"
{
Shader "shaders/EnvMapReflFake.gl"
texture tex_envmap "Textures/Environments/Your_Environment_Map_Name.jpg"
}
Here's a bit more advanced shader that also has an opacity mask to control reflections amount over a texture:
Code: Select all
Material material;
void SetupMaterial(inout Material material)
{
vec2 texCoord = vTexCoord.st;
material.Base = getTexel(texCoord);
vec4 addEnv = texture(tex_envmap, (normalize(uCameraPos.xyz - pixelpos.xyz).xy));
vec4 addEnvMask = texture(tex_envmap_mask, texCoord);
material.Base = (material.Base * 0.64) + (addEnv * 0.7 * addEnvMask);
}
Code: Select all
material texture "Models/Floors/DEM1_5_On_My_Model.png"
{
Shader "shaders/EnvMapReflFake.gl"
texture tex_envmap "Textures/Environments/Your_Environment_Map_Name.jpg"
texture tex_envmap_mask "Textures/Environments/Your_Environment_Map_Mask_Name.jpg"
}
The shader example, short test map, screenshot here