Vertexlit and Normal Map?

I’m good with code, but i’m rather helpless with shaders in general so i’m actually hoping for a handout or some good advice.

What i want it simply the default Vertexlit shader, but with a normal map. I’ve looked thru the vertexlit shader and it’ not that scary, but the other shaders with normal maps are alot longer and more complicated.

I’ve tried used the Self-Illum-Bump shaders, but this causes the object to be unaffected by lights.

I’ve learned to get the “perfect” look using Vertexlit, but as stated, i’d like to emply some normal maps as well. Anyone willing to help?

That’s not possible; normal maps require pixel shading.

–Eric

Hmm now that i think of it that makes sense. Suppose i’ll explore the self illumination type shaders a bit more.

You could write a custom shader for Embross Mapping (Bump mapping - Wikipedia) if you need to simulate what bump mapping does.

Anyways why do you need to use Vertex Shaders (Im not trying to critize you, Im just wondering.)

Well, i’m going for a certain look. trying to eliminate dark shading on my models. The vertex lit shader lets me adjust all sorts of brightness on the object and its still affected by ambient light and dynamic lights.

I attached a sample image of sorts.

I’m really trying to avoid ugly shading caused by low polygons.
Last image is normal mapped using SelfIlimunated Bumpmaped Diffuse. Which can be used, but much harder to get the right shade of brightness and isn’t affected by ambient light.


278554--9985--$normaled_138.png

A while ago I needed something similar, so I slightly altered the diffuse and bumped diffuse shaders to add an emissive color property. Attached are the shaders (kinda long to post as text), and you need the diffuse emissive shader in order for the bumped diffuse emissive shader to work, because of the UsePass dependency. The only thing is, they aren’t affected by ambient light anymore, because I didn’t need that…basically I replaced the ambient light with the emissive property. (Essentially I was using this as a kind of “per-material” ambient light.) You can either fix that, or hack around it by reading the ambient light and adding it to the emissive property of anything that uses these shaders.

–Eric

278563–9986–$diffuseemission_537.shader (7.96 KB)
278563–9987–$bumpeddiffuseemission_160.shader (6.05 KB)

The emmissive color really is the key to the vertexlit working for me. I could work around the whole ambient light thing by having some other variable to change if there’s a scene requiring it. I’ll give these shaders a shot later today and report back my findings.