Hi!
I want to pass a 2D rotation matrix (float2x2) from VS to PS.
I cannot use the TEXCOORD registers, because I use point sprites. Some graphics cards overwrite ALL point sprite registers when using point sprites.
I found only two options:
1) Use COLOR1. Problem: the values are clamped to 0-1. Solution: Scale them into the 0-1 range.
2) Pass the rotation amount as 1 float via VFACE and create the rotation matrix inside the PS.
Is there any way I can pass my matrix directly from VS to PS?
Thanks!
[HLSL] Passing float2x2 from VS to PS without using TEXCOORD
Not with extra tex-coords, enabling point sprites will thrash them (undefined behavior, the docs are enigmatic in this regard)
Recreating the matrix for every pixel sounds like wasted performance, so I'd go for 1). There was a XNA example somewhere which I currently don't find. Maybe you can (ab)use other semantics, never tried myself.
Edit: By the way: It does not look like you actually can write to VFACE from the vertex shader. Have you tried and did that work ?
Recreating the matrix for every pixel sounds like wasted performance, so I'd go for 1). There was a XNA example somewhere which I currently don't find. Maybe you can (ab)use other semantics, never tried myself.
Edit: By the way: It does not look like you actually can write to VFACE from the vertex shader. Have you tried and did that work ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement