Why need to have one vertex and one frag shader?

I always need to have at least one vertex and one fragment shader even I dont need one of them…

Why? Theres a way to bypass this?

I don’t like it anymore than you, but that’s what we have. There was a discussion of the pros and cons of it about a month or two ago that you might want to check out.

I am able to use just a vertex shader or just a fragment shader on an ATI 9600 XT using Catalyst 4.8 or 4.9 with no problems. When using a vertex shader with no fragment shader make sure you write to the proper built in GL varyings that feed the fixed function fragment pipeline. For a fragment shader with no vertex shader use the built in GL varyings from the vertex fixed function pipeline. Check out section 7.6 Varying Variables in the GLSL spec v1.1. It works on ATI hardware but I haven’t tried it on NVidia hardware with their current driver.

Works on NV, since the first driver supporting GLSL.

Why would you be forced to use both shader types?

Issue #1 in the arb_shader_objects spec says:
"1) What to do if part of a shader pair is not present?

DISCUSSION: There are several shader types that go together. For
example, a VERTEX_SHADER and a FRAGMENT_SHADER form a pair that is part
of the geometry pipeline. It is not required to supply both shader types
of a pair in a program object.

RESOLUTION: If one or the other of a pair is not present in the program
object, OpenGL will substitute the standard 1.4 OpenGL pipeline for the
one not present. The most likely place for this substitution to happen
is the link stage. Note that it is defined elsewhere exactly what part
of the OpenGL 1.4 pipeline a shader replaces."

It seems that there is quite some misinformation around. In a another thread someone said that you can attach only a fragment shader object and a vertex shader object to a program object. But that’s not the case as far as I understand.

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