Game Development Community

Custom Texture bug Water_NoReflect

by Michael Careaga · in Torque Game Engine Advanced · 06/18/2014 (12:37 am) · 1 replies

Hey there,
I was working on a little something when I noticed that the custom texture Water_NoReflect was not loading. I found that there is no shader "WaterCubeNoReflect" defined in ScriptsAndAssetClientScriptsShaders.cs. Anyone know if something exists out there for this?

#1
11/12/2015 (6:15 pm)
I was tinkering with TGE the other day and figured out the problem. For those of you still working on TGEA the shader data WaterCubeNoReflect is not defined in scriptAndAssets/client/scripts/shaders.cs. I added this code to the file just after the new Shaderdata( WaterCubeReflectRefract ) entry and before new ShaderData( WaterReflectRefract ). The Shader hlsl files exist but are not being used.

The code is as follows:
// Missing and added By KMdS to correct precompile error
// scriptsAndAssets/data/water/materials.cs (79): Register object failed for object Water_NoReflect of class CustomMaterial.
new ShaderData( WaterCubeNoReflect )
{
   DXVertexShaderFile 	= "shaders/water/waterCubeNoReflectV.hlsl";
   DXPixelShaderFile 	= "shaders/water/waterCubeNoReflectP.hlsl";
   
   OGLVertexShaderFile  = "shaders/water/gl/waterCubeNoReflectV.glsl";
   OGLPixelShaderFile   = "shaders/water/gl/waterCubeNoReflectP.glsl";
   
   samplerNames[0] = "$bumpMap";
   samplerNames[1] = "$reflectMap";
   samplerNames[2] = "$refractBuff";
   samplerNames[3] = "$fogMap";
   samplerNames[4] = "$skyMap";
   
   pixVersion = 2.0;
};

No more precompile error for this now. There may need some tweeking done to the associated files, but I won't know until I actually use the no reflect shader and see what if any problems there are. I do believe it should work though after looking at he code.