Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

geometry shader

1 view
Skip to first unread message

keith

unread,
Dec 18, 2009, 10:11:45 AM12/18/09
to
I have difficulty understanding how a vertex and geometry shader
interact. Does a geometry shader get the out variables of the vertex
shader? Can both a geometry and fragment shader get them? Also, can both
3 of them share uniforms, or is it impossible?

fungus

unread,
Dec 18, 2009, 11:51:01 AM12/18/09
to
On Dec 18, 4:11 pm, keith <johndoe64...@yahoo.com> wrote:
> I have difficulty understanding how a vertex and geometry shader
> interact.

They don't. They're completely separated.

> Does a geometry shader get the out variables of the vertex
> shader?


Yes.

> Can both a geometry and fragment shader get them? Also, can both
> 3 of them share uniforms, or is it impossible?

The geometry shader can pass values via (eg.) texture coordintes.

--
<\___/>
/ O O \
\_____/ FTB.

http://www.topaz3d.com/ - New 3D editor for real time simulation

keith

unread,
Dec 18, 2009, 10:23:04 PM12/18/09
to
fungus pravi:

> On Dec 18, 4:11 pm, keith <johndoe64...@yahoo.com> wrote:
>> I have difficulty understanding how a vertex and geometry shader
>> interact.
> They don't. They're completely separated.

Well, apparently they can communicate.

>> Does a geometry shader get the out variables of the vertex
>> shader?
> Yes.

Is this scheme then correct?

vertex shader -> geometry shader
-> fragment shader

Both get the out variables of the vertex shader then? Can both gs and fs
consume the same out variables?

>> Can both a geometry and fragment shader get them? Also, can both
>> 3 of them share uniforms, or is it impossible?
> The geometry shader can pass values via (eg.) texture coordintes.

You mean the built-in or user variables? How about the uniforms? Can
they be shared among the shaders?

Wojciech "Spook" Sura

unread,
Dec 22, 2009, 8:54:48 AM12/22/09
to
keith wrote:
> vertex shader -> geometry shader
> -> fragment shader

I know only vertex and fragment shader. What's the difference between vertex
and geometry shader?

Best regards -- Spook.


Timo Kunze

unread,
Dec 24, 2009, 5:31:26 PM12/24/09
to
Wojciech "Spook" Sura schrieb:

> keith wrote:
>> vertex shader -> geometry shader
>> -> fragment shader
>
> I know only vertex and fragment shader. What's the difference between vertex
> and geometry shader?
Vertex shader can modify existing geometry, geometry shader can produce
new geometry (e.g. new triangles).

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."

Timo Kunze

unread,
Dec 24, 2009, 5:37:20 PM12/24/09
to
keith schrieb:

> Is this scheme then correct?
>
> vertex shader -> geometry shader
> -> fragment shader
No, it's not. It's more like:
VS -> GS -> FS
with the GS being optional.

> Both get the out variables of the vertex shader then? Can both gs and fs
> consume the same out variables?

No. If you specify a GS, the out variables of the VS go to the GS. The
out variables of the GS go to the FS. The syntax for varying variables
has been extended for the GS: Use "varying in" for in variables and
"varying out" for out variables of the GS. The in variables of the GS
obviously are the out variables of the VS and the out variables of the
GS are the in variables of the FS.
Uniforms are the same for all shaders anyway.

0 new messages