setIBLRotation:: how to get the rotation matrix in vertex block #3957
JackKaiXing
started this conversation in
General
Replies: 1 comment 1 reply
-
I'm still not sure what you are trying to do. You could pass the ibl rotation as a parameter indeed, it's a single value since the rotation is constrained to the Y axis. Are you trying to keep a rectangle aligned to the camera? If so you may want to simply use a different vertex domain so you wouldn't have to deal with the IBL rotation at all. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello @romainguy ,
This discussion origins from issue #3951.
Let me describe what we are trying to achieve.
VBO
position attribute in world space
{0.0, 0.0, 0.0},{0.0, 0.0, 0.0},{1.0, 0.0, 0.0},{1.0, 0.0, 0.0}
custom attribute in world space,
{0.0, -1.0, 0.0},{0.0, 1.0, 0.0},{0.0, -1.0, 0.0},{0.0, 1.0, 0.0}
;IBO
{0,2,3, 0,3,1}
;Material Parameter
width
: float typevertex block
vec4 pos = material.worldPosition;
vec2 dir = getCustom0().xy;
material.worldPosition = vec4(pos.x + dir.x * width, pox.y + dir.y * width, pos.z, pos.w);
It works fine without setIBLRotation. What could help if I setIBLRotation?
Any other solution besides passing rotation matrix to vertex block?
Beta Was this translation helpful? Give feedback.
All reactions