I’ve also posted this to the SteamVR Developer Hardware forum: Need help for Splatmap Version of The Lab Renderer … but maybe there’s more help here than there ![]()
I’m currently trying to apply the Lab Renderer to some meshes which are using a splatmap shader and already have vr_standard_splat.shader which is based on vr_standard.shader and has additional slots for a control splatmap and four albedo layers.
In principle this already does what I need … except for one “little” detail: For the textures, I need 13/13 tiling but the control map obviously needs to use the plain uv-coordinates (without tiling).
Is there some easy way to get that information?
Basically, the relevant change is here:
//--------//
// Albedo //
//--------//
//float4 vAlbedoTexel = tex2D( g_tColor, i.vTextureCoords.xy ) * g_vColorTint.rgba;
float4 splat_control = tex2D(_Control, i.vTextureCoords.xy);
float4 vAlbedoTexel = splat_control.r * tex2D(_Splat0, i.vTextureCoords.xy).rgba;
vAlbedoTexel += splat_control.g * tex2D(_Splat1, i.vTextureCoords.xy).rgba;
vAlbedoTexel += splat_control.b * tex2D(_Splat2, i.vTextureCoords.xy).rgba;
vAlbedoTexel += splat_control.a * tex2D(_Splat3, i.vTextureCoords.xy).rgba;
float3 vAlbedo = vAlbedoTexel.rgb;
… the first line “float4 splat_control = tex2D(_Control, i.vTextureCoords.xy);” currently takes “i.vTextureCoords.xy”, which is scaled by tiling. That’s wrong ![]()
I’ve already tried adding “float2 splatUV : TEXCOORD0;” to PS_INPUT but that doesn’t work because “vPositionWs” already uses TEXCOORD0.
I’m obviously not well versed in shader programming ![]()
EDIT: If anyone wants to have a look, here’s a package with just that shader: ValveVRStandardSplat.unitypackage. This won’t be of any use if you haven’t imported The Lab Renderer … and it’s basically copies of vr_standard.shader and ValveShaderGUI.cs with some modifications.