Which coordinate space is the canonical default for each shader pipeline stage? -
i'm working direct3d 11 , hlsl. use 4 different shaders (vertex, hull, domain , pixel).
i have troubles using right coordinate space in shaders. identify appropriate space vertex, hull, domain , pixel shader stages?
typically, vertices streamed vertex shader in patch space, sort of local coordinate system describes areas tesselated (patches), may not describe model (polygons). hull , domain shaders work on these patches. hull shader runs in patch space, while domain shader runs half in patch space, passed hull shader control point function (a control point "patch level vertex"), , half in tangent space of patch (i.e. in plane of patch). allows know positions of new vertices in relation control points of patch. once tesselation complete, model can in either projection space, if have no geometry shader, or in model space if do. geometry shader can add or subtract vertices model, transform results projection space, , pass them pixel shader. final stage, pixel shader, operates in screen space (i.e. if query sv_position, in screen space).
while these common, can directly specify coordinates in projection space (if it's more convenient algorithm), world space, local space, transformed local space, tangent space, normal space, light space... you'd like. typical pipeline spaces i've listed, that, again, 1 example. it's you.
Comments
Post a Comment