thanks + i hope if someone can fix it
thanks + i hope if someone can fix it
looks like it needs to be normalised or limited to 1.0 🤔
Here's my attempt at maths:
Imagine you're looking down on the top edge of the card (red line), and rotating it to the blue angle.
We'll just rotate around the Y axis, which means the Y coordinates will not change, so we can ignore them for now.
The red line is the input X axis (also the card's width before rotating).
The blue line is the same length, but rotated by angle tiltX (in this case 60 degrees) around the centre (0.5, 0.5, 0.5 - as always in a shader, coordinates are in the range 0-1).
To get the pixel to sample, we divide the distance from A to B, by the distance from A to C. If In.x < A.x it is beyond the left edge of the card; if In.x > C.x it is beyond the right edge of the card.
Note that at this point, we just have an orthographic projection - there's no perspective effect yet (that will be done using the z value later).
This all works fine for tilting in either one direction or the other, but not both.
So how do we combine them?
Unfortunately, there's absolutely nothing on the internet about how to do this in a pixel shader, because it's something you would always do in a vertex shader.
Rotate 45
Scale x
Rotate -45
https://youtu.be/JFmrHaWOosY
This is another one made it but he don't want to share it i think
Link to a modified .mfa originally by Muddymole. I added two other add ons. Fake shader and rotate left to right only.
LINK: https://drive.google.com/file/d/1SC8...ew?usp=sharing