OBJ bump map = blue textures?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
WaxyChicken
Posts: 95
Joined: Sat Jun 25, 2011 6:15 am

OBJ bump map = blue textures?

Post by WaxyChicken »

Why are my textures coming out blue when i apply a bump map to them?

my map with out bump mapping in the OBJ loaded in irrlicht:
http://img440.imageshack.us/img440/438/ ... 111011.png

my map with bump mapping in the obj loaded in irrlicht:
http://img217.imageshack.us/img217/438/ ... 111011.png

my material node in Maya 2012 when bump map is applied:
http://img269.imageshack.us/img269/5639/grassnode.png

the texture in the screen shot:
http://img829.imageshack.us/img829/2743 ... round1.jpg

the bump map i'm applying
http://img36.imageshack.us/img36/8436/g ... d1bump.jpg

if i understand this post correctly then bump maps are supported in .obj + irrlicht
http://irrlicht.sourceforge.net/forum/v ... hp?t=43920
(stefbuet, 2nd from last post)
so what am i doing wrong?
_______________________________________________________
You could argue with me all day long about which language is best.
But what it comes down to is:
which language is best for YOU and which language is best for ME.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: OBJ bump map = blue textures?

Post by shadowslair »

Umm...
1) Do you apply some of the Irrlicht material types that use normalmap? (like for ex. similar to the one in 11.PerPixelLighting.exe example)
2) Are you using some shader?

After you do one of the above you gotta have some light correctly set up.

This ain`t an artists` community, neither a seers` one. Pictures will definitely help, but please show us some code. Especially the one where you set up your material and put the normalmap. :wink:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: OBJ bump map = blue textures?

Post by hybrid »

There's some support for automatic loading of bump maps in .obj files. But this requires a certain setup. It looks as if your normal map is simply used as diffuse map, probably nothingmore. Please also upload the .obj file and, more important, the material file.
WaxyChicken
Posts: 95
Joined: Sat Jun 25, 2011 6:15 am

Re: OBJ bump map = blue textures?

Post by WaxyChicken »

shadowslair wrote: 1) Do you apply some of the Irrlicht material types that use normalmap? (like for ex. similar to the one in 11.PerPixelLighting.exe example)
hybrid wrote:It looks as if your normal map is simply used as diffuse map, probably nothingmore.
you were both right.
Because my materials were not set up correctly the bump was being treated as a diffuse (engine default, i'm guessing).
now once i get the lighting bugs out it should solve the problem.
Image
each bump is applied to each surface correctly.

the part i still have a question about is:
multiple objects and textures/materials in the same .OBJ file.
is the bump-map for a Non-BumpMapped surface to default to the {first-or-last} bump-surface in the mtl file?

for example- the ground areas have bump maps and are now being rendered correctly (with exception of my lighting glitches)
but the building surfaces have no bump maps applied yet.
but the surfaces in the building are defaulting to one of the other bump maps.
as seen here:
Image

so are material effectors for an OBJ file a "All-Or-None" condition?
as in - "all must be diffused, or none must be diffused mapped. All must be bumped mapped or none must be bumped mapped."

Apologies if these questions sound a bit dense, but it's my first time trying to do lights, shadows, sharers in a 3D app.
_______________________________________________________
You could argue with me all day long about which language is best.
But what it comes down to is:
which language is best for YOU and which language is best for ME.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: OBJ bump map = blue textures?

Post by shadowslair »

Let`s say you have "N" count materials in your model. If its made of different meshbuffers, each of them points to different material in the [0, N] interval. Then, in each material you have some texture layers. So, for example for material "i" you`ll have sth like:

Code: Select all

node->getMaterial(i).setTexture(0, Driver->getTexture( "diffuseMapHere.jpg" )); // Texture layer 0
node->getMaterial(i).setTexture(1, Driver->getTexture( "normalMapHere.jpg" )); // Texture layer 1
The way the materials are assigned to the corresponding meshbuffers depends on your modelling application. And the way the texture layers will be used depends on your application.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
WaxyChicken
Posts: 95
Joined: Sat Jun 25, 2011 6:15 am

Re: OBJ bump map = blue textures?

Post by WaxyChicken »

Gotcha. :)
_______________________________________________________
You could argue with me all day long about which language is best.
But what it comes down to is:
which language is best for YOU and which language is best for ME.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: OBJ bump map = blue textures?

Post by mongoose7 »

The material file (.mtl) contains the specification for the materials. If you have a separate material for each part of your object, it will have different properties. There is no "globbing" of materials. The OBJ file loader creates a new mesh buffer for each material in use.

Look in your material file and see if you can explain what you see.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: OBJ bump map = blue textures?

Post by hybrid »

Although I'm not sure if the bump map support is working correctly in all cases. Again, just upload the files somewhere and I can have a look.
WaxyChicken
Posts: 95
Joined: Sat Jun 25, 2011 6:15 am

Re: OBJ bump map = blue textures?

Post by WaxyChicken »

http://www.megaupload.com/?d=Q3FKB3W0

info in the .txt
all OBJs are the same physical mesh with exception of "Sample-Obj-Bump"
exported from Maya 2012
_______________________________________________________
You could argue with me all day long about which language is best.
But what it comes down to is:
which language is best for YOU and which language is best for ME.
WaxyChicken
Posts: 95
Joined: Sat Jun 25, 2011 6:15 am

Re: OBJ bump map = blue textures?

Post by WaxyChicken »

problem has been found - a stray material command was floating around.

your obj loader is a work of art :D
_______________________________________________________
You could argue with me all day long about which language is best.
But what it comes down to is:
which language is best for YOU and which language is best for ME.
Post Reply