phong/normal at same time?


Wile E Coyote
08-20-2006, 01:13 PM
Okay, since I cannot actually see 3.0 phong shaders with my video card, I cannot experiment. IS IT POSSIBLE to use a phong shader for parts of a model and at the same time use a normal map for the entire model?

http://img124.imageshack.us/img124/1421/jhm8.jpg

Captain Spartacus
08-20-2006, 01:44 PM
When they release the phong thingy all the player models were shiny but after the fix in general forum thread only the helmet gives me that nice shiny look so it should be possible

SilentSteps
08-20-2006, 03:01 PM
You can give normal maps (bumpmaps) to the entire model, and specify phong shaders to the helmet only via the alpha channel in the normal map. However (for the record), as far as I know, you can't enable reflections (env_cubemap) and phong shader simultaneously.

Trp. Jed
08-20-2006, 03:54 PM
Currently the Alpha channel of the normal map dictates the intensity of the phong reflection. Black = none, White = full. As for the exponential map, that just indicates the strength of the specular reflection.

So yes, in theory if you dont want part of the model to show phong but still to show the normal map, just make those parts of the normal map alpha channel black.

Wile E Coyote
08-20-2006, 06:59 PM
Originally posted by Trp. Jed
Currently the Alpha channel of the normal map.....Danke. That was the missing ingredient I didn't see.

Trp. Jed
08-21-2006, 10:15 AM
Glad to be of service. :D

Vash
09-01-2006, 06:44 PM
Sorry to be a bit of a modeling nub around you fellows, but does the env_cubemap you speak of control the reflections you can see in the sniper rifle scopes? Seeing as how Silent Steps mentions he believes cubemaps and phong can't be utilized at the same time right now, it would explain why when I used the phongified v_model guns, I get no reflection on the scopes. I tried to transplant the VMT text from Wile's scoped rifle's (using his stuff mostly) but it's a no go. If I just use his stock non-phong VMT it's a go, if I use the phong VMT, or even the phong+Wile's VMT merged, it's a go for phong, no go for reflections.

Trp. Jed
09-01-2006, 06:54 PM
No I dont think so.

I looked at Jason Mitchells technical presentation on how the Phong render pipeline works and it doesnt seem to include any factoring in of Phong.

In fact, phong is actually a replacement of mirror type reflections so logically, no, they wouldnt be used together.

Vash
09-02-2006, 02:31 AM
Sorry Jed your reply confuses me a little, but I think I worded my question wrong too.

Basically, I can't seem to use a phongified v_model and have reflections on the scope of a sniper rifle at the same time. Conflict with something? Or did I edit the VMT wrong.

Sorry again, I know you answered my question to the best of your knowledge, although your guy's understanding of modeling tech is a bit above mine...

Trp. Jed
09-02-2006, 04:12 AM
Ah right, well in that case in theory it should work as long as the VMT material for the faces that are the scope don't have any phong.

What I was implying was that you cant have phong and env_cubemap reflections in the same texture but you should be able to to have one of each on the same model.

Vash
09-02-2006, 04:53 AM
All righty, now we're on the same page.

So: Phong + Reflections APPLIED to a model = good (theoratically)
Phong + Reflections on same TEXTURE (I guess an exponent map that covers the lenses?) = no go

Well seeing as how utilizing the non-phong VMT allows reflections to show, and using a phong VMT doesn't, I'm gonna have to assume that the exponent I'm using (from Something Wicked's Phong Pack V2) has exponent texturing over the lenses. Something not fore-seeable by any parties involved I'm sure, so I'll test that one out by seeing if I can "delete" the lense area in the exponent map.

Now I gotta rummage around in those phong tuts to get it right...

Thanks Jed for being up so late (or early...whichever) I just get really bugged about consistencies for games I like. (i.e. I could give a rats about consistencey in models for CS:S but I nitpick on everything for NS or DoD:S...)

BERSERK3R
09-02-2006, 01:40 PM
Originally posted by Trp. Jed
Currently the Alpha channel of the normal map dictates the intensity of the phong reflection. Black = none, White = full. As for the exponential map, that just indicates the strength of the specular reflection.

So yes, in theory if you dont want part of the model to show phong but still to show the normal map, just make those parts of the normal map alpha channel black.
So you are saying that if you want to have phong on a player model but not a BIT on sertain parts then you have to use bumpmaps?

Normally when I use phong on a model even if I use a 100% phong covered expmap (so i don't see phong at all) for example it still has phong but minimal but you can see minor reflections.

But that can be solved by using normalmaps????

Trp. Jed
09-03-2006, 10:54 AM
Ooh heck, I've opened a can of worms. I'll try and make this non technical.

When you're texture uses $phong 1 it processes the material through a different shader path than normal. When I say "path" its a series of tubes.... no wait, I mean it applies various shader processes and combines the results to give the final phong texture.

Now for the phong path, when it calculates the specular hightlight for a given texture pixel, it takes into consideration the normal map too. It needs to do this to make sure that the appearence of the normal map doesnt get lost.

It just so happens that for the phong path, it always looks for the specular intensity in the alpha channel of the normal map. In theory if you dont have a normal map made you can just make it just one single colour (RGB 128,128,255). However you will need an alpha channel to say how strong the phong reflection is for a given pixel. Black is no reflection, white is full strength.

The exponent map denotes how shiny the surface is per pixel of the texture. Black is the least which means a broad, diffuse reflection and white is the strongest meaning a sharp white point of light.

So you dont *need* a real normal map per say, you can just make a texture filled with RGB 128,128,255 but you will need to define a bumpmap and make sure that that texture has an alpha channel.

BERSERK3R
09-03-2006, 01:50 PM
Originally posted by Trp. Jed [....]

So you dont *need* a real normal map per say, you can just make a texture filled with RGB 128,128,255 but you will need to define a bumpmap and make sure that that texture has an alpha channel. [/B]
First, thank you for this detailed information!

I tried to see if I learned something of this and so I made a texture with RGB 128 128 255 and then gave it a mask (parts that must or must not shine at all).
The mask was or 100% alpha or 0%, so the result should be very clear.

Then my vmt code looked something like this:

basetexture: my texture (no alpha)
bumpmap: file I just explaned with the alpha

phong: 1
<other phong settings>
<no expmap>

So what I wanted to achieve was to have some parts don't show phong at all by the normalmap alpha, but I what I saw was that the whole model was phonged evenly.

So what did I do wrong?
Can you give me an example with texture and its alpha and order of vmt code etc?

Also this was not really about not to show phong at sertain parts of a normal map but just not show on the _basetexture_ .

213
09-11-2006, 09:53 PM
what normal map+phong looks like:

http://img226.imageshack.us/img226/4046/doddonner0001os7.jpg

http://img226.imageshack.us/img226/4964/doddonner0007vk0.jpg


what's cool about is that rim lighting looks ever better cause now there are groves and bumps on the edges.

Splinter
09-14-2006, 06:00 PM
makes the player model look wet and very much non-organic :\

Deceiver
09-14-2006, 06:28 PM
Nice! Thinking of releasing that for the default models/skins?

213
09-16-2006, 01:18 AM
Originally posted by Splinter
makes the player model look wet and very much non-organic :\

the guy who made that didn't modify the helmet or skin...the clothes are a bit shiney, but less shine wouldn't be noticeable. i like it and in real life everything reflects light in a way, especially if they were smooth like leather, so it wasn't too far from the truth.

the bumps and groves are the most excellent. youcan notice much detail at the thigh and knee area where there's much wrinkle

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.