Ogre v2.2.4 release missing shadow normalOffsetBias etc.

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

Ogre v2.2.4 release missing shadow normalOffsetBias etc.

Post by Lax »

Hi dark_sylinc,

you published the new Ogre 2.2.4 version, which I updated in git. But now the shadow improvements are missing in that version.

* normalOffsetBias
* constantBiasScale

etc.

I'm using the branch origin/v2-2, which is the version:

Code: Select all

#define OGRE_VERSION_MAJOR 2
    #define OGRE_VERSION_MINOR 2
    #define OGRE_VERSION_PATCH 5
    #define OGRE_VERSION_SUFFIX ""
    #define OGRE_VERSION_NAME "Cerberus"
Is this intended? Or what can I do, before that, I used the old master, which was before the vulcan stuff. So the branch "origin/shadow_bias_improve"
was included. I thought you wanted to include the "origin/shadow_bias_improve" branch in the new Ogre version?


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: Ogre v2.2.4 release missing shadow normalOffsetBias etc.

Post by dark_sylinc »

This is intended. Shadow offset bias is a 2.3 feature (currently master branch).

Updates to the 2.2 branch are supposed to introduce bug fixes or minor breaking changes.
Shadow offset bias is a major breaking change as it can globally affect the existing lighting/shadowing of all scenes.
Or what can I do, before that, I used the old master, which was before the vulcan stuff. So the branch "origin/shadow_bias_improve"
Update to latest master? See 2.3 preparations ticket for any breaking change. The master branch should be quite stable.

Alternatively, privately merge master before vulkan stuff with the v2.2 branch. Please note that before merging the vulkan stuff, the master branch was already tagged as 2.3

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

Re: Ogre v2.2.4 release missing shadow normalOffsetBias etc.

Post by Lax »

Hi dark_sylinc,

thanks for the info! I totally forgot, that new features like vulkan can be configured or disabled in cmake.
That did the trick.

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

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

Re: Ogre v2.2.4 release missing shadow normalOffsetBias etc.

Post by Lax »

Hi dark_sylinc,

just another important question: As I'm comparing what has changed in the hlms tutorials, I see that vulkan has been introduced everywhere. Since I do not use vulkan yet, is this automatically detected? Because I'm afraid, that when I merge everything, that nothing will work anymore.

Can I merge all compositor/hlms stuff without hesitation?

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: Ogre v2.2.4 release missing shadow normalOffsetBias etc.

Post by dark_sylinc »

Lax wrote: Sat Sep 26, 2020 10:38 am just another important question: As I'm comparing what has changed in the hlms tutorials, I see that vulkan has been introduced everywhere. Since I do not use vulkan yet, is this automatically detected? Because I'm afraid, that when I merge everything, that nothing will work anymore.
Major changes are 2:

1. RootLayouts. This is, at least for now (and quite possibly foreseable future) Vulkan-only. i.e. failure to setup a RootLayout will only impact Vulkan (it's ignored by the other RenderSystems)

2. ReadOnlyBuffers. This affects all RS and is a performance optimization (also we needed this to support Android). To quote documentation:
Represents the best way to access read-only data.
But how it is implemented depends largely on which HW/API it is running on:
  • Buffer<> aka texture buffer in D3D11 on D3D10+ HW
  • samplerBuffer aka texture buffer in GL3 on GL3/D3D10 HW
  • SSBO aka UAV buffer in GL4 on GL4/D3D11 HW
  • SSBO aka UAV buffer in Vulkan
  • Metal doesn't matter, there are no differences between TexBuffer & UavBuffer,
    however we consume the slots reserved for tex buffers.
In short, it either behaves as a TexBufferPacked or as an UavBufferPacked (but read only)
depending on HW and API being used.
Some existing code has changed to use ReadOnlyBufferPacked where it originally used TexBufferPacked.
This means in shader code, these buffers should be accessed via the readOnlyFetch() macro.

i.e.

Code: Select all

// GLSL
// old code:
float4 value = texelFetch( matrixBuf, idx );
// new code
float4 value = readOnlyFetch( matrixBuf, idx );

// Note that readOnlyFetch macro may expand to either
float4 value = matrixBuf[idx]; // Modern GPUs
float4 value = texelFetch( matrixBuf, idx ); // Old GPUs
In HLSL the difference is less noticeable, but variables are now declared as StructuredBuffer<floatN> instead of Buffer<floatN>

Additionally, Matrix functions in Matrix_piece_all.glsl/hlsl have been modified to only work with matrices stored in ReadOnly buffers instead of Tex buffers.

If your custom modifications to Hlms access buffers that are now ReadOnlyBufferPacked, you need to change your shaders to use readOnlyFetch. This may sound scary but it's just routinely changing code that refuses to compile with the new syntax.
Lax
Gnoll
Posts: 659
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 63

Re: Ogre v2.2.4 release missing shadow normalOffsetBias etc.

Post by Lax »

Hi dark_sylinc,

ok, thanks for the advice. Indeed I could use the new shader code successfully without having vulcan in use.
Topic can be closed.

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