Fixed pipeline normal mapping on iPhone

Is it posible to write fixed pipeline "reflective shader with normal map"? If so, how?

more ▼

asked Dec 15, 2010 at 10:22 AM

avatar image

Paulius Liekis
9.4k 76 80 115

(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

You want a cubemap reflection perturbed by a normal map, per pixel? No, that's not really possible with fixed function.

And yeah, there's no performance difference between programmable & fixed function shaders, if you do the shaders right. The programmable GPUs these days do not have any fixed function stuff, so they just generate shaders behind the scenes. In Unity's OpenGL ES 2.0 implementation we do generate the shaders ourselves, since GLES2.0 does not have fixed function stuff at all.

more ▼

answered Jan 03, 2011 at 03:15 PM

avatar image

Aras ♦♦
1.8k 1 12 30

(comments are locked)
10|3000 characters needed characters left

For the programmable pipeline, check out the 4-th last shader (Example/WorldRefl Normalmap) here.

This should compile out to multiple passes in the compiled shader and I believe that would include the passes for fixed-function cards if applicable, no?

more ▼

answered Dec 15, 2010 at 04:23 PM

avatar image

11.4k 18 43 116

You might be right, although I'm not certain. My suspicion is that these shaders will do much more than I want: like include lights and so on. I just want to have base texture with environment reflection in some areas.

Dec 16, 2010 at 10:21 AM Paulius Liekis

It's fairly easy to write an unlit programmable shader that does what you ask. Could you elaborate on why it must be "fixed pipeline", if you don't mind my asking?

Dec 16, 2010 at 05:55 PM skovacs1

it must be wrong belief that fixed pipeline is faster :)

Dec 17, 2010 at 08:26 AM Paulius Liekis

I cannot say that it is not faster at all, but there are reasons that there is a programmable pipeline and that shaders can run code - a fixed-function pipeline is very restrictive and harder to read and write. In general, while they may be marginally more performant, restricting yourself to fixed-functions is generally going to make your life much harder. Unfortunately for your question, that is beyond where I and most users here in UnityAnswers are willing to fight with it. If you want an unlit normal-mapped reflective programmable shader, I can help with that however.

Dec 17, 2010 at 03:43 PM skovacs1
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Dec 15, 2010 at 10:22 AM

Seen: 2602 times

Last Updated: Dec 15, 2010 at 10:22 AM