Search found 10 matches

by iceguan
Sun Nov 24, 2019 3:57 pm
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

:D Glad to help. I plan to implement some advanced shader examples as supplements when I get free.
by iceguan
Fri Nov 08, 2019 12:38 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

CuteAlien wrote:Is there any chance you could change the license to zlib license for this? Then it'll fit into Irrlicht.
Okay. I will check for that on Github.

EDIT:

I have changed the license to zlib. Please let me know if there is a problem. :wink:
by iceguan
Sun Nov 03, 2019 3:30 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

Oh that's cool! I'll check it once more next week, but on first view looks pretty good - I think we can use it like that. That's if you are OK, with us putting it into the engine? Tiny details I'm thinking about (but probably don't matter)... Not sure about mipmap filter... it's likely not doing an...
by iceguan
Sat Nov 02, 2019 9:53 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

OpenGL indeed flips the texture matrix (I think this is going back to some image format, TGA probably, which was used in the OpenGL predecessor IRIS GL)... I wrote a simple post processing example recently and hosted it on Github at https://github.com/BoshenGuan/Irrlicht-Post-Processing-Example . H...
by iceguan
Wed Oct 23, 2019 12:48 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

I think we even have some light shaders in OGL branch already. Doing something with a ScreenQuad is also a good idea. Still considering if I should adding a screenquad class or struct to Irrlicht, thought not quite sure where it fits. So just adding it as example for now is maybe a way to do that. ...
by iceguan
Mon Oct 21, 2019 5:11 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

Uh... looking at shaders. Nothing makes sense? - mLightPos is actually the camera position (maybe deliberate - but then still bad naming...) - worldpos is calculated using the transpose world matrix instead of just world-matrix. - normal should use either world-matrix (without non-uniform scaling t...
by iceguan
Thu Oct 17, 2019 3:05 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

devsh wrote:Should be correct if mul(matrix, vector) means a transpose of front multiply (since A^T.B^T = (AB)^T )
Yes, mul(invWorld, normal) should be correct.
by iceguan
Thu Oct 17, 2019 3:01 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Re: Normal transformation problem of Shaders example

Could be because it's mul(vector, matrix) instead of mul(matrix, vector). But just guessing, one of those simple questions which would take me a few hours to answer until I figure it all out again. Thanks for reply! In mul(vector, matrix) form just like the one in the example shader, the matrix I t...
by iceguan
Wed Oct 16, 2019 8:01 am
Forum: Advanced Help
Topic: Normal transformation problem of Shaders example
Replies: 16
Views: 6295

Normal transformation problem of Shaders example

From example 10. Shaders example, in d3d9.hlsl,   // transform normal float3 normal = mul(float4(vNormal,0.0), mInvWorld);   The normal is transformed by mInvWorld. But I think it should be transformed by mInvWorldTrans, which is transposed of the inversed world matrix. Which one is correct? I am ve...
by iceguan
Tue Mar 27, 2018 1:22 pm
Forum: Beginners Help
Topic: FOV horizontal, vertical
Replies: 4
Views: 1393

Re: FOV horizontal, vertical

I have just tested. setFov set Vertical FOV (Irrlicht 1.8.1), for sure