Operating System: Windows 10
Render System:OpenGL/DirectX 11
Hi Ogre devs. I am working on an app where I implement PBR shading. I used GLTF2 example provided by the Ogre Samples.
It works fine in OpenGL mode. Now I tried to switch to DirectX11 ,getting white surface and Ogre spits the following warning:
Now, I am new to Ogre material ecosystem,but I skimmed through the setup of the PBR sample's pbr.program and it seems likeOgre: Warning: material glTF2/PBR has no supportable Techniques and will be blank. Explanation:
Pass 0: fragment program glTF2/PBR_fs cannot be used - compile error.
the same vertex/fragment shader source files are supposed to be used both for GLSL and for HLSL:
Code: Select all
vertex_program glTF2/PBR_vs hlsl glsl glsles
{
source pbr-vert.glsl
preprocessor_defines HAS_NORMALS,HAS_TANGENTS,HAS_UV
}
fragment_program glTF2/PBR_fs_glsl glsl
{
source pbr-frag.glsl
preprocessor_defines MANUAL_SRGB,SRGB_FAST_APPROXIMATION,HAS_NORMALS,HAS_TANGENTS,HAS_BASECOLORMAP,HAS_NORMALMAP,HAS_EMISSIVEMAP,HAS_METALROUGHNESSMAP,HAS_OCCLUSIONMAP,USE_IBL,USE_TEX_LOD
}
fragment_program glTF2/PBR_fs_hlsl hlsl glsles
{
source pbr-frag.glsl
target ps_2_a
preprocessor_defines MANUAL_SRGB,SRGB_FAST_APPROXIMATION,HAS_NORMALS,HAS_TANGENTS,HAS_BASECOLORMAP,HAS_NORMALMAP,HAS_EMISSIVEMAP,HAS_METALROUGHNESSMAP,HAS_OCCLUSIONMAP,USE_IBL
}
fragment_program glTF2/PBR_fs unified
{
delegate glTF2/PBR_fs_glsl
delegate glTF2/PBR_fs_hlsl
}
Here https://ogrecave.github.io/ogre/api/1.1 ... grams.html
it looks like each fragment_program uses different source file, hlsl or glsl. On the other hand, the GLSL code in GLTF2/PBR sample doesn't look
like "pure" GLSL so one may imply it gets translated into API specific syntax before being compiled.
I need help on this one. Do I have to write separate, API specific shader source code per rendering API or this is something else?
Thanks.