[2.2] OpenGL rendering issues

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Lax
Gnoll
Posts: 659
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 63

[2.2] OpenGL rendering issues

Post by Lax »

Hi,

I'm testing OpenGL3Plus with newest Ogre version and got some serious rendering issues.

Log Info:

Code: Select all

GPU buffer pools (meshes, const, texture, indirect & uav buffers): 49/64 MB
GPU StagingTextures. In use: 0 MB. Available: 176 MB. Total:176
GPU Textures:	236 MB
CPU Textures:	0 MB
Total GPU:	476 MB
12:37:02: Vertex Shader: 100000016VertexShader_vs
Fragment Shader: 100000016PixelShader_ps
 GLSL link result : 
Vertex info
-----------
error: binding mismatch between shaders for SSBO (named _varName__arg_)

Fragment info
-------------
0(1300) : warning C7050: "pixelData.envColourS" might be used before being initialized
0(1300) : warning C7050: "pixelData.envColourD" might be used before being initialized

Link info
---------
error: different buffer variables (named worldMatBuf[0] and f3dLightList[0]) sharing the same offset within a storage block (named _varName__arg_) between shaders
error: members of storage block (named _varName__arg_) are not the same between shaders
12:37:06: [GameObject] Creating Gameobject 3918538002 for scene node name: Plane_0
12:37:06: [DatablockPbsComponent] Init datablock pbs component for game object: Plane_0
12:37:06: [PlaneComponent] Init plane component for game object: Plane_0
12:37:16: Mesh: Loading barrel.mesh.
12:37:16: WARNING: barrel.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshTool tool.
12:37:16: Vertex Shader: 100000014VertexShader_vs
Fragment Shader: 100000014PixelShader_ps
 GLSL link result : 
Vertex info
-----------
error: binding mismatch between shaders for SSBO (named _varName__arg_)

Fragment info
-------------
0(1303) : warning C7050: "pixelData.envColourS" might be used before being initialized
0(1303) : warning C7050: "pixelData.envColourD" might be used before being initialized

Link info
---------
error: different buffer variables (named worldMatBuf[0] and f3dLightList[0]) sharing the same offset within a storage block (named _varName__arg_) between shaders
error: members of storage block (named _varName__arg_) are not the same between shaders
12:37:19: Mesh: Loading Bed1.mesh.
12:37:19: WARNING: Bed1.mesh is an older format ([MeshSerializer_v1.41]); you should upgrade it as soon as possible using the OgreMeshTool tool.
12:37:19: Vertex Shader: 100000020VertexShader_vs
Fragment Shader: 100000020PixelShader_ps
 GLSL link result : 
Vertex info
-----------
error: binding mismatch between shaders for SSBO (named _varName__arg_)

Fragment info
-------------
0(1303) : warning C7050: "pixelData.envColourS" might be used before being initialized
0(1303) : warning C7050: "pixelData.envColourD" might be used before being initialized

Link info
---------
error: different buffer variables (named worldMatBuf[0] and f3dLightList[0]) sharing the same offset within a storage block (named _varName__arg_) between shaders
error: members of storage block (named _varName__arg_) are not the same between shaders
See:
http://www.lukas-kalinowski.com/Homepag ... Issues.png

When I load a sky, the sky is visible, but the whole thing is getting even more weird.
See:
http://www.lukas-kalinowski.com/Homepag ... Issues.png
I tried to place barrel mesh, but its stuck on the top (no raycast working) and looks really strange.

Log info:

Code: Select all

12:43:00: Vertex Shader: 100000014VertexShader_vs
Fragment Shader: 100000014PixelShader_ps
 GLSL link result : 
Vertex info
-----------
error: binding mismatch between shaders for SSBO (named _varName__arg_)

Fragment info
-------------
0(1303) : warning C7050: "pixelData.envColourS" might be used before being initialized
0(1303) : warning C7050: "pixelData.envColourD" might be used before being initialized

Link info
---------
error: different buffer variables (named worldMatBuf[0] and f3dLightList[0]) sharing the same offset within a storage block (named _varName__arg_) between shaders
error: members of storage block (named _varName__arg_) are not the same between shaders
12:43:09: FreeImage error: 'FreeImage_Save: failed to open file ./Captures/2020-10-8_43_9.png' when loading format PNG
Strangly, terra does work corretly with OpenGL :) But as discussed in Post viewtopic.php?f=25&t=96011. The heightmap is faulty with DirectX.

By the way: I carefully compared the shaders (hlms, materials and .gl). I only create a topic, if I have no idea anymore, what could be wrong.

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5446
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1348

Re: [2.2] OpenGL rendering issues

Post by dark_sylinc »

I can repro this bug too.

It appears it breaks on Windows MSVC 2019 Debug mode, but works fine on Release, and works fine on Linux (any config).

Our macro parser is supposed to write "_worldMatBuf" but in MSVC Debug mode it always writes: "_varName__arg_" hence causing name clashing

Additionally the LocalCubemaps sample on Windows is broken only on Debug mode; the wrong shaders are bound. Edit: The cause is the same, the wrong shaders are bound because the shaders that are supposed to be used failed to link due to the name clash.

*Sigh*, I'll have to understand what's going wrong. Probably some C++ undefined behavior or memory corruption.

This is an Ogre bug.

As a workaround you can edit "mReadOnlyIsTexBuffer = false;" and comment it out in OgreGL3PlusVaoManager.cpp
This will force the older path which should work ok:

Code: Select all

if( _supportsSsbo )
{
    // mReadOnlyIsTexBuffer = false; // <---- Comment this
    alignment = 1; //initial value according to specs
    OCGE( glGetIntegerv( GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &alignment ) );
    mUavBufferAlignment = std::max<uint32>( alignment, 16u );
}
Btw. you titled "2.2" but I assume you meant 2.3?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5446
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1348

Re: [2.2] OpenGL rendering issues

Post by dark_sylinc »

Fixed. Thanks for the report.

Please note that after upgrading to the latest version to get this fix you must MANUALLY DELETE YOUR OLD MICROCODE CACHE.
Otherwise the problem will remain.

Cheers
Matias
Lax
Gnoll
Posts: 659
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 63

Re: [2.2] OpenGL rendering issues

Post by Lax »

Wow, thanks for fixing. That was fast! :D

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62