Hi all,
I’ve been playing around with the DX11 geometry shaders. In particular the StreamOut_Rebind example from the girlpower folder of the DX11 pack.
Currently all box instances that are created in the Box_Batcher shader face in the same direction. I would like to modify the shader so that each box is rotated in the direction of the vertex normal (or the interpolated normal for vertices with the same xyz coordinates).
Since I’m quite new to HLSL I haven’t figured out how to modify the code. I guess I somehow need to multiply output.pos with a transform matrix that considers the normals.
Any suggestions?
Attached is a patch of the result that I want to achieve but done in the old-fashioned way. Would be great to achieve the same thing inside the DX11 shader directly.
AlignToGeometry.v4p (13.6 kB)