Sign in to follow this  

Normal Map (HLSL)

This topic is 2589 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
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

This topic is 2589 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this