Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,702 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,389 people online right now. Registration is fast and FREE... Join Now!




Model Shapes to Bumpmaps

2 Pages V  1 2 >  
Reply to this topicStart new topic

Model Shapes to Bumpmaps, Is it possible to generate a normalmap texture from model shape using

WolfCoder
post 12 Sep, 2008 - 11:48 AM
Post #1


ギュウ~

Group Icon
Joined: 5 May, 2005
Posts: 3,575



Thanked 6 times

Dream Kudos: 1450
My Contributions


Basically to draw some of the textures I'm actually going to model them as well as I possibly can using Blender and take a high-resolution picture of the surface head-on and use that picture as the texture. Then, I want to generate a normalmap for the model that is used with the texture to tell whatever shader how to normalmap the texture, giving it the classic bumpmapping effect, but on the actual model shape and not on the generated texture picture.

Here's a breakdown of my idea:


1) Model a surface, for example, a side of a crate. I would physically model each block of wood next to each other, and then model a metal frame binding them together, and then model each nail, and anything else I can possibly think of in blender to the best of my ability. I've got a 3D model of a crate wall, basically at this point.

2) Light the model so that it appears as it would with ambient light, or any way I wish.

3) Take a high-resolution snapshot of the model looking directly head-on to the model. I now have a high-resolution picture of the model which looks like the crate texture I wanted. It will be put on a flat surface in the game, implying depth just like a texture has always done in a 3D game.

4) Somehow generate a normalmap based on the actual shape of the model to go with the texture.

5) In the game, the texture will be displayed with the normalmap, and the bump-mapping shader will light the surface as though the actual model shape was there, implying depth further.


This has been done in Half Life 2 all the time, if you listen to the commentary in Half Life 2: Lost Coast the developer explains how he made a very high polygon model and generated normalmaps for it, and put it and the model texture on a lower polygon model to give the illusion of detail.

I'm doing this for level surfaces, I can do this much better than if I drew the textures by hand in Photoshop and it will look more realistic, and take me less time to make each texture because I love modeling more than painting.

Sounds good? So, is it possible for Blender to generate normal maps like I asked?

EDIT:
I'll actually have the model saved in a format I can use, and orient the edges so that they can physically replace the flat textures and be tessellated with an experimental process. This will be used for the experimentally high graphic setting on the game.

The normal setting is the texture w/ bump mapped normal map.

And the lower setting is textures only with standard lighting.

And the lowest is half-resolution textures with standard lighting.

This way I can put incredibly detailed shapes on simple shapes I make using WED Level Editor, allowing those who have insane gaming rigs to enjoy the game, and allowing those with crappy half-converted gaming rigs to still be able to play my game on the lower settings.


This post has been edited by WolfCoder: 12 Sep, 2008 - 11:52 AM
User is offlineProfile CardPM

Go to the top of the page

bobjob
post 12 Sep, 2008 - 03:37 PM
Post #2


D.I.C Head

**
Joined: 29 Mar, 2008
Posts: 61



Thanked 1 times
My Contributions


You any good at making models, wanna make models for my game biggrin.gif

to answer your question, in blender its called baking.

what you want to do is take a high poly object, then bake it on a low poly object. there are a few rules that you need to consider when doing this, the high poly model should be convex, any concave bits will loose information, and take data from the closer bit to the model, which usually looks crap.

So you gotta look up the term baking, and its "tangent" baking.

you can take a snap shot, but in order to get the model looking good, there is always tweeking of the UV mapping.
it works fine for Box's (6 snapshots) but will be anoying for more complex shapes.

video baking tutorial in blender
User is offlineProfile CardPM

Go to the top of the page

WolfCoder
post 12 Sep, 2008 - 06:54 PM
Post #3


ギュウ~

Group Icon
Joined: 5 May, 2005
Posts: 3,575



Thanked 6 times

Dream Kudos: 1450
My Contributions


I'm baking to a flat rectangular box, pretty much. Then I align the normal map and the bitmap to each other and save them for my texture library.

And no, I'm not that good of a modeler.
User is offlineProfile CardPM

Go to the top of the page

stayscrisp
post 14 Sep, 2008 - 02:54 PM
Post #4


D.I.C Regular

***
Joined: 14 Feb, 2008
Posts: 258



Thanked 6 times
My Contributions



Argh no!!

Baking is actually something else i think, like if someone created a full 3D model with all the bells and whistles of skeletal animation and all that jazz, but all you really wanted was a low poly less than 4000 tris Md2 model, then you could bake the pre done animations and other stuff onto it, 3D students say baking is anything that you dont really want to do but makes a nice botch job for things :s

then again 3d students :s

hehe

User is offlineProfile CardPM

Go to the top of the page

bobjob
post 14 Sep, 2008 - 05:22 PM
Post #5


D.I.C Head

**
Joined: 29 Mar, 2008
Posts: 61



Thanked 1 times
My Contributions


QUOTE(stayscrisp @ 14 Sep, 2008 - 03:54 PM) *

Argh no!!

Baking is actually something else i think, like if someone created a full 3D model with all the bells and whistles of skeletal animation and all that jazz, but all you really wanted was a low poly less than 4000 tris Md2 model, then you could bake the pre done animations and other stuff onto it, 3D students say baking is anything that you dont really want to do but makes a nice botch job for things :s

then again 3d students :s

hehe


Baking example
Here is a youtube video of baking in action. Im not fimiliar with other uses of the word "baking" but this type, is definetly taking a high poly model and putting its normal information onto a dot3 normal map, then wrapping it on the low poly model
User is offlineProfile CardPM

Go to the top of the page

WolfCoder
post 15 Sep, 2008 - 05:11 AM
Post #6


ギュウ~

Group Icon
Joined: 5 May, 2005
Posts: 3,575



Thanked 6 times

Dream Kudos: 1450
My Contributions


Yeah, I would just call it normal mapping.
User is offlineProfile CardPM

Go to the top of the page

stayscrisp
post 16 Sep, 2008 - 05:06 AM
Post #7


D.I.C Regular

***
Joined: 14 Feb, 2008
Posts: 258



Thanked 6 times
My Contributions


QUOTE(WolfCoder @ 15 Sep, 2008 - 06:11 AM) *

Yeah, I would just call it normal mapping.


yup


Bump Mapping is Normal Mapping isnt it?
User is offlineProfile CardPM

Go to the top of the page

bobjob
post 16 Sep, 2008 - 01:41 PM
Post #8


D.I.C Head

**
Joined: 29 Mar, 2008
Posts: 61



Thanked 1 times
My Contributions


QUOTE(stayscrisp @ 16 Sep, 2008 - 06:06 AM) *

QUOTE(WolfCoder @ 15 Sep, 2008 - 06:11 AM) *

Yeah, I would just call it normal mapping.


yup


Bump Mapping is Normal Mapping isnt it?


normal mapping is the dot3 mapping, which is the colored bump map
bump mapping is traditionally using the grey scaled image.
User is offlineProfile CardPM

Go to the top of the page

WolfCoder
post 17 Sep, 2008 - 02:33 PM
Post #9


ギュウ~

Group Icon
Joined: 5 May, 2005
Posts: 3,575



Thanked 6 times

Dream Kudos: 1450
My Contributions


Bump mapping is like raising dots in braille, more of a simple emboss.

Normal mapping can be explained, as far as I understand, as information regarding the immediate angle of the pixel at that point to be lit as though the entire surface is at that angle (hence normal). So even though a surface may be 45 degrees off the x-axis, the normal map lights each pixel in their own angle from the surface creating a realistic shape when lightning is applied.

So for a normal of (0,0,1) which defines a line pointing straight up perpendicular from the surface, it is lit at the 45 degree angle. As far as I know, it appears that the R, G, B colors in the normal map relate to the normal vector, defined in Euler angles (pan, tilt, roll) or a vector of unit length 1 magnitude(x,y,z)=1, whichever it is (I'm not sure).

This post has been edited by WolfCoder: 17 Sep, 2008 - 02:37 PM
User is offlineProfile CardPM

Go to the top of the page

stayscrisp
post 17 Sep, 2008 - 03:27 PM
Post #10


D.I.C Regular

***
Joined: 14 Feb, 2008
Posts: 258



Thanked 6 times
My Contributions



I think bump mapping is loosely applied to all techniques as you described, normal mapping is the most commonly used method of bump mapping but others such as parralax mapping fall into the same category, but hey its really cool anyway.
i dont think parallax mapping would be very viable in realtime though hehe
User is offlineProfile CardPM

Go to the top of the page

bobjob
post 17 Sep, 2008 - 09:03 PM
Post #11


D.I.C Head

**
Joined: 29 Mar, 2008
Posts: 61



Thanked 1 times
My Contributions


QUOTE(stayscrisp @ 17 Sep, 2008 - 04:27 PM) *

i dont think parallax mapping would be very viable in realtime though hehe

sad.gif My game uses parallax bump mapping.

I think parallax is one of the better ones, it can stil have a height map without a lightsource, which is really good, if u only want 1 light source, and an ambient color.
User is offlineProfile CardPM

Go to the top of the page

stayscrisp
post 18 Sep, 2008 - 03:06 AM
Post #12


D.I.C Regular

***
Joined: 14 Feb, 2008
Posts: 258



Thanked 6 times
My Contributions


Whatever floats your boat smile.gif

Displacement mapping is pretty cool as well.

This post has been edited by stayscrisp: 18 Sep, 2008 - 03:07 AM
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 08:10AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month