Hi guys, I'm looking to find out how you go about texturing your low poly models when they have their normal maps/bump/spec applied.. ?
I've been trying to use max but I find it a pain in the arse as I dont get a clear view of what things look like until I render the scene. Can anyone recomend ar alternative??
The max view port will display the normal map (in a low rez manner) but obviously I need to see the combination of bump/spec etc so that I can make changes as needed.
Replies
Are you running direct X as your display driver? If so you can turn on direct X shared for the material and see it in real time.
You need a DX 9 (Or is it 8?) enabled gfx card.
However - this is not great because
a) slow
b) it'd not the same as it will display in game, depending on the game lighting.
I haven't noticed the Metal Bump shader washing out my textures, although again, like the viewport shader, the normal-map doesn't display as well as it should.
You could try turning a viewport to ActiveShade, not as fast as a viewport, but better than a full render, I reckon.
Apart from that and Doom3, I think you'll just have to wait until you can use UE3's UnrealEd? :P
However, does the Doom3 display have much control over specular maps and such?
I didnt realize that Doom3 would be able to update without restarting the application every time changes are made...
Im assuming there is some sort of console command to update the scene?
However, does the Doom3 display have much control over specular maps and such?
Um, what control do you mean? All it does is take your spec map and apply it to the model, the spec map can be full color. Your map obviously has to do the rest but I doubt any engine will offer you more control than that.
Only problem with it is that it doesn't have a slot for specular maps, just a color and a value. But for doing the color and normal, it's great!
http://www.monitorstudios.com/bcloward/resources_shaders.html
edit: and it looks like his normal map specular shader does have a slot for a specular map, but only through the diffuse texture's alpha channel. So no color specular map .
One problem you'll get with previewing your maps straight in doom3 is that, its, well, doom3. And it won't give you the shading you might expect from your normalmap as it only shades properly nmaps that have been generated BY doom3.
There is, however, that one free viewer by Derton that allows you to use MD5s and ASEs and it will combine your maps in the exact same way doom3 does, except that it will work with 'classic' normalmaps wich is what you want.
Funny thing, I'm working on a tutorial about all that right at the moment
I personnally like to use Max's normalrender (or whatever its called!) in the bump slot. It's not realtime but gives you full access to everything, diffuse, bump, normal, spec. I also like to use the same 3point light setup for all my models so that I am sure they are painted the same way. In the end you'll obviously need to adjust gammas to make it work in the particular engine you are using but it's a necessary step anyways (wich is often just a matter of darkening the specmap ALOT!)
More words about that as soon as I have that tut done
Pior, I'll be looking out for that tutorial
These conventions are:
Red channel - Black = facing left, White = facing right
Green channel - Black = facing up, White = facing down
You'll have to set up your normal map generation tool/method to take this into account and you should have no problems. I've found that on both models and flats, Doom3 and Max would generate identical normal maps (except for filtering differences, of course).
But then again, there may be specific instances where there are differences. Any examples, Pior? We might be able to work around them.
This is all in XSI btw. Sorry.
Would you like a version of my shader that uses a color specular map? I think I could do that. Any other features you'd like?
Welcome to the board.
As for the Doom3/Max differences :
A Max rtt:
And a map out of doom3 generated with the same source meshes :
I can spot differences where the lowpolyedges are supposed to be, its really obvious on the arms... I think it's just Doom3's way to counter balance some harsh gouraud or something, but its not realted to X or Y swithch as they are both using the Nvidia's convention and not ati's.
The weird thing is that Doom3 seems to be the only engine relying on that!
Any idea?
Dunno which is "correct" though, I would assume Doom's generation method should be better suited for its renderer, but I've made a pretty good amount of Doom3 assets using Max 's rtt and haven't noticed any lighting abnormalities.
Also, Doom3 renderbump takes too long when supersampling, and I prefer more control over my projection cage. (Also helps to generate all of your bakes in Max so they all match up)
Thanks for the insight, Pior.
bumpmap addnormals(*normalmap*, heightmap(*bumpmap*, *bump intensity*));
If you change your material file you have to use reloadDecls but that can be bound to another key.
The 3-light Normal-Map shader crashes Max7 for me, though - I've got a Radeon 9800 Pro, that should be enough to handle it, right? The other normal map shaders all seem to work fine.
I also discovered that the Y-axis (green channel) in your standard normal-map/spec shader is flipped compared to the output Max7's normal-mapper outputs by default - having an option/checkbox to choose which style of normal-mapping to use would be awesome.
I'd also love to see a shader that allowed a coloured specular bitmap!
Also, any ideas on why the 3-light normal map shader is crashing Max would be much appreciated. Thanks for all the effort, I'll definitely be using these shaders in future!
I also discovered that the DX9 shader "RTTNormalMap.fx" that ships with Max, actually displays normal-maps in the viewport much better than the DX9 manager synced to a standard material - however, it doesn't support specular mapping, so Ben's shader seems to be the best choice...
This one takes the opacity-map from the alpha channel of a 32-bit diffuse texture.
It's essentially all Ben Cloward's work, so I left all his info in the top of the file, I guess if anyone needs this they can use it until he releases a "real" version, which I'm sure will be much improved my version
http://www.spearmint.pwp.blueyonder.co.uk/normal_map_spec_opac.fx is where you'll find it...
Ben: If this isn't kosher, I'll take it down...
MoP
Im using the Unreal Engine 3 and its unfortunate that you cant just save your maps and see them update in realtime. you have to re import your maps to your package everytime you make a change. :[
http://www.cgtalk.com/showthread.php?t=244102
MoP: My normal map shader handles the mirror issue better than Max's but it's still not quite right. If you apply it to a sphere, cut the sphere in half and mirror it, you'll see what I mean. Put a point light close to the mirrored side and you'll see that the vertex lighting is correct, but the normal mapping bumps are still going in the wrong direction. There's nothing I can do about it. It's a Max thing. - But yeah, it's better.
Nice job on figuring out how to get transparency to work! I don't mind you doing that at all. I posted those for people to use so it's good to see that thet're getting some use - and especially cool that you've gone so far as to figure out how to add features!
The only problem is that in that shader the diffuse texture alpha channel is now being used for a specular mask AND for transparency.
When I make the shader that uses a color map for a specular mask (hopefully tonight if I get some time) that will free up the diffuse alpha channel so it will work correctly for transparency. I hope to be able to post that tomorrow sometime.
The three light shader crashes Max because it's using pixel shader 2.0a (because it calls for lots of instructions) and ATi cards don't support that profile. I didn't know that when I posted it. ATi cards do support pixel shader 2.0b though. Try this:
Find two lines toward the bottom of the shaders that look like this:
"PixelShader = compile ps_2_a"
and change them so they look this this:
"PixelShader = compile ps_2_b"
If "b" doesn't work then try "c." I'd test it myself but I don't have an ATi card. Does it work?
I tried altering the ps_2_a to b and then c, but with ps_2_b, it crashed the same way as with A, and C gave me this:
"unsupported compiler target 'ps_2_c'"
I guess it's just my graphics card then... shame, I'd have liked more than 1 light on my preview.
If you write the transparency thing into your shader which utilises the separate coloured specular map, that would be awesome... I noticed with mine that if you have overlapping opacity-mapped planes with the shader, they sometimes display weirdly (sorting issues, i guess), but I don't know if there's a way round that in the shader, or if it's just an inherent problem with the way the viewports work, or something.
Keep up the great work, man, these shaders are a huge bonus!
MoP
The overlapping opacity sorting thing is also a Max issue. There's nothing I can do about the sort order.
If you guys make something cool that uses my shaders, be sure to post it and/or let me know. I'd love to see it.
The shader now works with ATi cards! It turns out it wasn't all that hard to break it up into three passes - so now it can just use pixel shader 2 instead of 2a.
I added a color specular mask so you can control the color of the specular highlight per-pixel.
I added a check box that allows the shader to support poth positive and negative Y normal map formats (Good idea, MoP!)
You can grab the new version of the shader here:
http://www.monitorstudios.com/bcloward/shaders_NormalMapSpecular3lights.html
I tried adding transparency to it also, but I ran into a few problems with it. I'm going to talk to some of the programmers at work today and see if they can help me get the transparency working. In the mean time, tell me what you think.
turn on AlphaBlend in first pass, and do
srcblend = ALPHA
destblend = ONE_MINUS_ALPHA
for the others make
srcblend = ALPHA
destblend = ONE
make sure your colorout.alpha is always the one from the texture which defines transparency
I am not familiar with .fx so well, mostly doing OpenGL stuff so some terms might be different.
But that makes me also wonder why the ID techs decided to go for an 'alternate' (lets call it this way) nmap read/generation by default, while the 'classic' nmaps we see generated everywhere else work quite well already?
Or maybe the cmd line I used was not the actual one used by ID, don't know, I just followed Vahl's tut haha But then I *think* I remember than the original Imp model, while loaded and rendered in Max, rendered quite strangely normalmapwise.
It's so weird, I don't feel like Doom3 with the 'alternate' nmaps looks better than any other nextgen engine available... Or maybe it behaves better with very lowpoly models? I have the feeling D3s models are quite lighter than the UT2007 ones for instance. Maybe the alternate Nmaps allow for better rendering in case like 4 sided cylinders or something. Strange to see it has not been discussed further already?
Interesting.
You can now download a transparency version of my 3 Lights Normal Map shader. It's on the same page (URL above) as the regular version.
That makes, again, complete sense Whatever state you ears are in you are 100% clear to me, I've been wondering about that thing for so long. And I think it also explains the artifacts I've seen on six-sided shapes, arms and the like. Good good. Carmack is as smart as he used to be