• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# more bump mapping...

## Recommended Posts

FreJa    154
Hi, I thought I had solved this problem already, but no... I'm trying to implement bump mapping on a model, but look at the result: the man is kinda black, and the bump mapping isn't very believable... By the way... I'm using the ARB extensions... Any help? Thank you

##### Share on other sites
FreJa    154
And if anyone is really interested in giving a hand... here''s the important part of the code:

MainWnd.cpp
Normalisation Cube Map.cpp
Normalisation Cube Map.h

thank you really a lot

##### Share on other sites
FreJa    154
weird... I now tried with a cube and with different texture and it SEEMS, I repeat, it SEEMS, to be working... look at the shot:

what do you think?

[edited by - FreJa on July 8, 2003 10:04:20 AM]

##### Share on other sites
mrrolf810p    122
Try this. Draw your normal vectors for each triangle. See if they make sense. If they do, then try drawing your S and T vectors to see if they make sense (this is a little harder to tell).

There are a couple things that I noticed with your code also:

-Do all 3 vertices in each triangle have the same n,s,t vectors? You might want to 'smooth' them out by calculating the vertices normal, and not the triangles. This is done by calculating every triangle's normal, and then averaging them accordingly for the vertices.

-I don't think you are saving your S and T vectors after you calculate them:

VECTOR3D tempSTangent=deltaT1*side0-deltaT0*side1;
sTangent.Normalize();

All this does is normalize sTangent. maybe change it to:

sTangent = deltaT1*side0-deltaT0*side1;
sTangent.Normalize();

I'm not sure how your math is set up, but I think that is right.

Let me know if this helps. I also have a md5 model viewer that (tries) to bumpmap, But it's not working 100%. Maybe we can help each other out.

Robbie

[edited by - mrrolf810p on July 8, 2003 10:10:30 AM]

##### Share on other sites
Unreal    124
Is this a doom3 character? were did you find the loader?

##### Share on other sites
FreJa    154
quote:
Original post by Unreal
Is this a doom3 character? were did you find the loader?

##### Share on other sites
FreJa    154
thanks mrrolf810p, but I still couldn't make this work...

quote:
Original post by mrrolf810p
I don't think you are saving your S and T vectors after you calculate them

you're write... but when I "corrected" it, it looked even more strange...

quote:
Original post by mrrolf810p
Maybe we can help each other out.

would love that...

[edited by - FreJa on July 8, 2003 11:44:10 AM]

##### Share on other sites
mrrolf810p    122
Have you tried to draw the normals when you render the scene?
Also see if everything looks fine with no bumpmapping, just GL_LIGHTING.
That helped me out a little bit. I''ll look over what you posted a little more carefully once I have a chance... I''m at work now.

Tonight I''ll get out my program and see what''s in there. I''ll try to post a pic for ya.

What is the md5mesh file called for the fat guy? I just got the marine up and going.

##### Share on other sites
FreJa    154
everything works just fine... all textures (bump and diffuse) are rendered correctly)...

quote:
Original post by mrrolf810p
What is the md5mesh file called for the fat guy?

try facepain.md5mesh

[edited by - FreJa on July 8, 2003 1:07:28 PM]

##### Share on other sites
mrrolf810p    122
Hey

here is a quick screenie of what I got. Notice the nice triangles. I can''t get them to smooth out.

Looking through your code real quick, I''m not sure if you are giving the correct LightObject, LightEye vectors. Have you played around with those?

##### Share on other sites
FreJa    154
done it already... but I get the same problem you do:

whats wrong?

[edited by - FreJa on July 9, 2003 7:26:23 AM]

##### Share on other sites
c t o a n    163
You might want to try recomputing the normal map using your own methods (or maybe the Plug-In for Photoshop from nVidia) using the texture heightmap provided with the demo. You''ve got to wonder, however, that if shared vertices are in fact, shared, they should have the same ''averaged'' normal as the same-spatially vertices on other polys. If this is true, then how can you see the edges of polygons, when as far as the lighting is concerned, they don''t exist? You might want to see how your S, T, and N vectors look at the shared vertices. Just my two cents... Anyway, I love the MD5 models, though they are set up a bit wierd, though not only am I using them as models, but also as a potential format to convert Maya files into. These things rock!

Chris Pergrossi
< ctoan >
My Realm

##### Share on other sites
mrrolf810p    122
quote:
Original post by c t o a n
You might want to see how your S, T, and N vectors look at the shared vertices.

So you think the S and T vectors neec to be shared and ''averaged'' also?

Here is a picture just using GL_LIGHTING. The model is smooth in most places, hints that the normals are correct.

I''ll look into averaging the vertices even if they are not ''shared'', but are in the same place.

Thanks