[2.1+] Planar Reflection doesn't work (with fix) Topic is solved

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


Post Reply
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

[2.1+] Planar Reflection doesn't work (with fix)

Post by rujialiu »

Hi!

In the latest commit, planar reflection doesn't work anymore. The code in question:

Code: Select all

struct PS_INPUT
{
@insertpiece( VStoPS_block )
    float4 gl_Position: SV_Position;
    @foreach( n, hlms_pso_clip_distances )
        float gl_ClipDistance@n : SV_ClipDistance@n;
    @end
};
For some reason, foreach doesn't work as expected so gl_ClipDistance0 is not defined. It can be fixed by reverting foreach to property:

Code: Select all

struct PS_INPUT
{
@insertpiece( VStoPS_block )
    float4 gl_Position: SV_Position;
    @property( hlms_pso_clip_distances )
        float gl_ClipDistance0 : SV_ClipDistance0;
    @end
};
I've tested both D3D11 and Metal and they both work after the fix.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5586
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1413
Contact:

Re: [2.1+] Planar Reflection doesn't work (with fix)

Post by dark_sylinc »

Are you sure you're on latest?

That bug was fixed a few months ago. The problem was that:

Code: Select all

@foreach( n, hlms_pso_clip_distances )
Should've been:

Code: Select all

@foreach( hlms_pso_clip_distances, n )
The latest version has the correct one. What commit hash are you working on?

Cheers
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

Re: [2.1+] Planar Reflection doesn't work (with fix)

Post by rujialiu »

dark_sylinc wrote: Wed Aug 29, 2018 11:01 pm Are you sure you're on latest?

That bug was fixed a few months ago. The problem was that:

Code: Select all

@foreach( n, hlms_pso_clip_distances )
Should've been:

Code: Select all

@foreach( hlms_pso_clip_distances, n )
The latest version has the correct one. What commit hash are you working on?

Cheers
Oops, I didn't update Ogre 2.1 for exactly one month :D (though I updated Ogre 2.2 yesterday)
I'll update immediately.
Post Reply