Hi, all!
I want to check the resulting shaders after OgreUnifiedShader.h. Generally I want to make sure I won't break hlsl shaders without testing them...
So I want to see if unified version is equivalent to original hlsl shader...
Hi, all!
I want to check the resulting shaders after OgreUnifiedShader.h. Generally I want to make sure I won't break hlsl shaders without testing them...
So I want to see if unified version is equivalent to original hlsl shader...
you can simply use cpp. E.g. in Media/Main:
Code: Select all
cpp -DOGRE_HLSL=4 -DOGRE_VERTEX_SHADER -I. ShadowBlend.vert
also you can cross compile stuff with gcc-mingw-w64 and test it with wine.
The problem is I'm total noob with DirectX and HLSL and used OpenGL all my life since the early days and sort of ok with GLSL and HLSL syntax is alien to me. So I wonder if there are some tools to check HLSL or generate both HLSL and GLSL from some GLSL subset so I won't leave my comfort zone and still be compatible? Running with wine would be to cumbersome every time, Cg is dead, HLSL2GLSL is too ancient and glslang is by aliens for aliens...
I remembeer there were some tools but when I started searching I could not find any, so maybe here I could get some help?
slapin wrote: Sat Jun 28, 2025 9:32 pmor generate both HLSL and GLSL from some GLSL subset so I won't leave my comfort zone and still be compatible?
thats the purpose of OgreUnifiedShader.h
you can also read it in reverse to find how GLSL maps to HLSL:
https://github.com/OGRECave/ogre/blob/f ... ader.h#L23
if you are asking all of this because of OgreWater, just let ChatGPT translate the HLSL to GLSL for you, then add the OgreUnifiedShader macros and you should be good.