Literata
Literata

Reputation: 305

OpenGL ES 2.0 and Shaders

Two questions:

  1. Is there a way to render to the screen without using a shader in OpenGL ES 2.0?

  2. Are there default vertex and fragment shaders which I could use in lieu of defining my own?

Not trying to achieve anything other than wrapping my head around OpenGL ES 2.0.

Upvotes: 0

Views: 303

Answers (2)

Christian Rau
Christian Rau

Reputation: 45948

  1. No, not in ES 2.0.

  2. Not built in, but you may find some on the net. Though what makes a reasonable default shader depends highly on what you actually want to do. Do you just want to render colored primitives? in 2D or 3D? Do you need lighting? Which parameters define your lights? Do you want texturing? Those rather basic questions already define what your shader will look like.

On the one hand the problem is that you need a different shader depending on each situation and render style you want to achieve. But on the other hand those shaders won't be that complex if adapted to a particualr use case. A simple 3D lighting vertex shader doesn't need to be larger than 5 lines of code (the actual shader function only) and the corresponsing fragment shader doing texturing some 1 line of code.

But you won't get around understanding how shaders work and how to interface with them. Once you got this, writing your own shaders for the usual use cases becomes a piece of cake. I suggest you to look into some good tutorial or book on OpenGL ES 2.0. This should properly introduce the basic principles of shaders and how to realize the usual standard computations, like vertex transformation, lighting, texturing with them.

Upvotes: 1

navillus
navillus

Reputation: 56

OpenGL ES 2.0 does not define any default shaders unfortunately.

OpenGL ES 1.0 is a fixed pipeline only and does not allow shader definitions, whilst OpenGL ES 2.0 allows shader definitions but does not include any fixed pipeline(ie default shaders)

Upvotes: 0

Related Questions