D3D11HLSLProgram::getLayoutForPso missing VES_SPECULAR

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


User avatar
bishopnator
Goblin
Posts: 299
Joined: Thu Apr 26, 2007 11:43 am
Location: Slovakia / Switzerland
x 11

D3D11HLSLProgram::getLayoutForPso missing VES_SPECULAR

Post by bishopnator »

Hi, I think in the implementation of D3D11HLSLProgram::getLayoutForPso there is missing check for VES_SPECULAR.
The D3D11Mappings::get(VES_SPECULAR) returns "COLOR" - the same value as for VES_DIFFUSE, but below the VES_SPECULAR is not checked and hence SemanticIndex is not properly incremented.

Image

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

Re: D3D11HLSLProgram::getLayoutForPso missing VES_SPECULAR

Post by dark_sylinc »

A bigger question I'm now asking myself is why does VES_SPECULAR still exist?

I vaguely remember leaving it for backwards compatibility reasons when porting from 1.x.

It is troublesome because its real meaning only makes sense in the fixed function pipeline where lighting was calculated per vertex. From a shader POV VES_SPECULAR is no different from an additional set of VES_TEXTURE_COORDINATES.

If we go down to source code, only OpenGL & Metal are supporting it.
EDIT: I was wrong. Vulkan supports it too.

Are you ok with me marking it as deprecated instead of implementing it? Or were you planning on using it?

Cheers

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

Re: D3D11HLSLProgram::getLayoutForPso missing VES_SPECULAR

Post by dark_sylinc »

Ah nevermind. I pushed a fix. Thanks!

I still kinda want to deprecate it. Thoughts?

User avatar
bishopnator
Goblin
Posts: 299
Joined: Thu Apr 26, 2007 11:43 am
Location: Slovakia / Switzerland
x 11

Re: D3D11HLSLProgram::getLayoutForPso missing VES_SPECULAR

Post by bishopnator »

For me it is perfectly ok to deprecate it. I have no intention of using it :-) I looked there in the function due to other reasons and only spotted it there.