New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triplanar mapping #358
Triplanar mapping #358
Conversation
…tail maps (WIP and non-working: this is just the C++ part)
…added to HLSM Terra datablock)
…triplanar mapping on HLMS Terra detail maps
Works in DX11, but there is a crash in OpenGL3+ and Vulkan when pressing T (for triplanar), pixel shader has an error. |
It seemed I had tested It both in OpenGL and Vulkan, but I could be wrong... What's the error? |
So this is in Ogre.log when I press T on GL3+
Honestly I can't even because the line numbers given in .log point to empty lines in .glsl. But I suspected and changed the only pow from that triplanar line for blend factors |
Okay found a way, have to delete the block at start from I fixed the first issue with pow by replacing
saying I can't put a float3 into float.
to this
BTW this happened for me on Windows 10 in GL3+ with integrated Intel GPU and did also on Debian 11 with AMD GPU. |
Well spotted, congrats and thank you! :) As you correctly identified it, the problem is that OpenGL and Vulkan don't implicitly cast from float to float3. I'm quite busy in these days, but I'll try to fix it ASAP. |
Merged manually! I fixed the problems. After fixing the pow3, another problem arise which boiled down to: float4 a,b,c;
#define Foo() a + b + c
float value = Foo().x;
// Which translates to:
float value = a + b + c.x; // The result is a float4!!! Cannot be casted down implicitly
// Solution:
#define Foo() (a + b + c)
float value = Foo().x; // Everything's alright now I was surprised that this works on GL3+ as well! (because GL uses a basic macro parser, and that multi-line macro looked scary) Thanks for your contribution! |
Hi @darksylinc in case you missed my post, I'm also adding link here |
This was a feature that I had in my engine for a while and, rather than letting it die with him, I preferred to make it available to the community (since someone also asked for it). As the title says, it adds support for enabling/disabling triplanar mapping on HLMS Terra detail maps.
Some remarks:
Some screenshots (left w/o triplanar mapping; right w/ triplanar mapping):