REQ: S3O normal-maps

REQ: S3O normal-maps

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

Post Reply
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

REQ: S3O normal-maps

Post by Kloot »

I recently added the necessary C++ infrastructure to calculate vertex tangents
Tangents.png
(427 KiB) Downloaded 118 times
for non-empty S3O model pieces (if defined as triangles or tristrips, quaddies get left in the cold) to Spring. That means you'll be able to easily try out techniques such as normal-mapping and friends via Lua-side shaders (or at least those of you familiar with GPU programming will ;)) on any new and existing models after the next engine release. I've also prepared an example shader widget, so if you provide me with some normal-maps (and the S3O's to which they should be applied if those aren't readily up for grabs) I'll slip you a sneak peak. (The maps are required to be in tangent-space and should follow the UV layout of your diffuse textures, ie. they should look like this rather than like this or like this.) Nvidia's PS plugin is probably one of the quickest ways to generate them if you can live with the results.
Last edited by Kloot on 09 Jan 2009, 15:41, edited 5 times in total.
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: REQ: normal maps

Post by thesleepless »

awesome, i'd like to try this out, normal maps are pretty easy to generate
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: REQ: normal maps

Post by Hoi »

Making a hipoly model and then generating it is better then the plugin though.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: REQ: normal maps

Post by Argh »

Yay!
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: REQ: normal maps

Post by Hoi »

while we're talking about normal maps anyway, what are the diffrences between
Image
and
Image?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: REQ: normal maps

Post by Argh »

@Hoi: The first example appears using non-tangental vectors, so far as I can see from a glance.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: REQ: normal maps

Post by Hoi »

So, what does that mean? the wikipedia article on normal mapping doesn't have the information I need, what are the pros and cons of the 2?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: REQ: normal maps

Post by Pxtl »

Hoi wrote:So, what does that mean? the wikipedia article on normal mapping doesn't have the information I need, what are the pros and cons of the 2?
Okay, in one case the normal map is relative to the whole model, in the other the normal map is relative to the polygon that the map is stuck to.

Notice how, while the shape of the model is unwrapped, the shading of the normal map in the face doesn't really looked "unwrapped" - the stuff on the left is shaded to face the left, the stuff on the right is shaded to face the right. In the other case, it just looks embossed - the shading of normal map looks like it is generally facing outwards with some details. Don't know the pros and cons - I imagine animating the latter works much better, since the normals will move with the individual polys.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: REQ: normal maps

Post by Argh »

Well, basically, you want all of your bumps to face "out" from the triangles of the surface, insofar as that's possible. Normal maps don't perform correctly, if you feed them garbage data about your vectors in relation to the vertexes of your object.

IOW... the easy way to do normal maps, for mechanical crap, is to just do a grayscale, with somewhere around 128,128,128 as the "neutral" value, everything above / below it lighter / darker, then use the nVidia DDS plugin (or ATi's Compressionator, or any number of other tools) to transform this into a normal map, for a simple (and admittedly simplistic) bumpmap effect.

For really sophisticated stuff, like volumes on high-detail organics, etc, I think that it's just plain impossible to do, without a complex high-poly model and Blender or another modeling / rendering environment that can render normalmaps.

BTW, Wings can be used as a subdivision surface modeler, or export tool for export to such an environment, and you can, IIRC, force all facets to quads, which might be an extremely light / cheap way to get them into certain applications used for 3D painting and have them work well.

Just build your model as usual... set up the uvmap (very important, must do this part BEFORE), save the model... export to Wings (or just make new file with a copy of the original, or whatever) convert all triangles back to facets, then to quads, then export to Deep Paint 3D or whatever. Should work, in theory.
User avatar
thesleepless
Posts: 417
Joined: 24 Oct 2007, 04:49

Re: REQ: normal maps

Post by thesleepless »

the way i do it,

for mechanical things, i'll make my model then make a duplicate, add details to its mesh, once the low poly model has UV maps you can then bake the tangent normals onto the texture.

i'll try and make a tutorial for it soon
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: REQ: normal maps

Post by rattle »

Argh wrote:@Hoi: The first example appears using non-tangental vectors, so far as I can see from a glance.
The first one looks traced while the others look generated...

red: left to right
green: up to down
blue: height (bumpmap)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: REQ: normal maps

Post by Argh »

BTW, if you want to mess around with generating normalmaps using a high-detail mesh, here's a tool to help get you started:

http://developer.nvidia.com/object/melody_home.html
krychle
Posts: 46
Joined: 01 Jul 2006, 00:09

Re: REQ: S3O normal-maps

Post by krychle »

Best Blender tutorials for baking textures...

Normal maps:

http://wiki.blender.org/index.php/Manua ... ormal_Maps

http://blenderartists.org/forum/showthread.php?t=138194

Ambient occlusion for nice shading:

http://www.katsbits.com/htm/tutorials/b ... errain.htm
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: REQ: S3O normal-maps

Post by rattle »

I've baked a normal map in Blender before, it's part of the noob to pro wikibook. So you may want to look at that.

I've also done several AO bakes in Blender and I have to say, unless you use Blender for modeling as well, I'd try to use a different tool, because setting the model up for baking can be rather painful and time consuming. The same applies to baking normals.
User avatar
Wolf-In-Exile
Posts: 497
Joined: 21 Nov 2005, 13:40

Re: REQ: S3O normal-maps

Post by Wolf-In-Exile »

Kloot, here's a roughly done model with normal mapping, 2116 tri model, normal map generated from 32k hi-poly.
Didn't separate the parts cause I figured its only for testing and the polycount's too high anyway.

If you want it lemme know where to send it.

The normal mapped details aren't very deep, but the rounder edges translated quite well although I didn't bother cleaning up the normal map much.

Image
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: REQ: S3O normal-maps

Post by trepan »

I don't know what format yall are going to use for your heightmaps,
but I suggest you standardize on a format the also contains the
normalized depth component, example:

channels:
R(0) Nx (Normal X component)
G(1) Ny (Normal Y component)
B(2) Nz (Normal Z component)
A(3) Dp (normalized depth)

You can also use a theta/phi system for the normal (score an
extra channel for something else), but that means that there's
going to be more GPU calcs.

The normalized depth component can be used for such shader
techniques as relief mapping (self-shadowing. It's also handy
for the simpler parallax shading technique, which is standard
normal mapping, but with a texture offset based on the depth
component and view vector. You can also use the depth
component for displacement mapping.

I've recently added lua client-side scripting to the BZFlag game.
Yall might benefit from the shaders and material management
scripts that are being used there (join the test server, save the
world). Here's a screenshot of plain relief mapping (haven't added
lua rendered shadow mapping, yet):

Image

P.S. the primary texture format that I use for opaque materials is RGBS(specular)
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: REQ: S3O normal-maps

Post by Hoi »

Trepan that is win and it would even more win if it'd be in the next spring version :wink:
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: REQ: S3O normal-maps

Post by trepan »

It's already in Spring, you just need to write the lua and shaders
(or copy it from the work that I'm doing for BZFlag).

P.S. One thing that BZFlag does better than Spring (imo), is that
they use X/Y for the ground plane. That might affect how some
of the code would work. The other adjustment I made to the lua
GL API for BZFlag is that all GL resources are done with lua
userdata objects (including dlists, textures, and shaders).
User avatar
Keithus
Posts: 155
Joined: 06 Oct 2006, 05:59

Re: REQ: S3O normal-maps

Post by Keithus »

Woot, normal maps. ^^ Introduce bones for organic rigs and spring will be an engine to be feared.... or used.
Post Reply

Return to “Art & Modelling”