ViewPortArray with Geometry Shader

Hello,

I’d like to use ViewPortArray and a GeometryShader to place objects in the same 3D scene but render them in different ViewPort depending on an Index input.

The only interesting documentation I found about this topic is here : DirectX10 Tutorial 7: Viewports | Taking Initiative

But unfortunately I’m not able to make it working as the compiler throws the following error :

“Output variable (Vertex Shader) contains a system-interpreted value (SV_ViewportArrayIndex) which must be written in every execution path of the Shader. Unconditional initialization may help.”

Also there aren’t much information around the web… Any tips maybe ?

Thx

ViewPortArrayTest.zip (4.1 KB)

Not sure, but you can try how it works when you do array from gs.

This semantics specified on output of geometry shader, what you have to do something like passthru gs and add uint vp : SV_vieportindex on GS_OUT

Then you normally press some kind of hidden pin in render texture array ;) not sure it will work with normal render. Will try to hack that together.

Hey,

I think you also can use a VIEWPORTINDEX semantics for your needs. Check the commented part in geometry shader with ViewPort instead of ViewportArray…

ViewPortArrayTest_01.zip (5.6 KB)

Well it’s looking bit weird but works ;]

viewport array should be specified in pixels

ViewportIndex.zip (4.7 KB)

nice one, thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.