Jump to content
  • Advertisement
Sign in to follow this  
VitaliBR

Normal Map (HLSL)

This topic is 2813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a map made in 3DStudio MAX and exported in .x

Some objects of the map are using normal map (bump map)
I have to use the normal map (image) with DirectX 9.c? I can apply for some of the meshes of the .x using HLSL?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
I have to use the normal map (image) with DirectX 9.c?

Assuming you mean bump/normal mapping for lighting purposes, bump mapping just changes the way light affects the appearance of an object. You can still render the object without those lighting effects.
Quote:
I can apply for some of the meshes of the .x using HLSL?

You can render meshes using HLSL. For both bump mapping and object rendering using HLSL, I would suggest Frank Luna's book Introduction to 3D Programming With DirectX 9.0c.. A Shader Approach.

Share this post


Link to post
Share on other sites
I'm sorry, think expressed myself badly (my english is poor)

I was wondering whether we can apply the normal map in only one object of my mesh (.x)

for example:
In a mesh with a box and a ball, I wanted to apply the normal map just on the ball

Thanks

Share this post


Link to post
Share on other sites
Quote:

In a mesh with a box and a ball, I wanted to apply the normal map just on the ball

If this mesh is exported "correctly" to have 2 subsets (ball & box)
then you need to do something like:

effect->SetTechnique("tBumpMap");
effect->SetMatrix(...);
...
effect->Begin(0, 0);
effect->BeginPass(0)
mesh->DrawSubset(0);//assumed that sphere is in first subset
effect->EndPass();
effect->End();

...
effect->SetTechnique("tOtherMaterial");
effect->SetMatrix(...);
...
effect->Begin(0, 0);
effect->BeginPass(0)
mesh->DrawSubset(1);//assumed that box is in second subset
effect->EndPass();
effect->End();

Share this post


Link to post
Share on other sites
Quote:
Original post by belfegor
Quote:

In a mesh with a box and a ball, I wanted to apply the normal map just on the ball

If this mesh is exported "correctly" to have 2 subsets (ball & box)
then you need to do something like:

effect->SetTechnique("tBumpMap");
effect->SetMatrix(...);
...
effect->Begin(0, 0);
effect->BeginPass(0)
mesh->DrawSubset(0);//assumed that sphere is in first subset
effect->EndPass();
effect->End();

...
effect->SetTechnique("tOtherMaterial");
effect->SetMatrix(...);
...
effect->Begin(0, 0);
effect->BeginPass(0)
mesh->DrawSubset(1);//assumed that box is in second subset
effect->EndPass();
effect->End();


Thanks :D
I don't know that you can use through subset

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!