Jump to content
  • Advertisement
Sign in to follow this  
Medo Mex

Loading Mesh with Specular Level

This topic is 2066 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 create a mesh in 3Ds Max, sometimes I apply specular level in the materials window which make the mesh appears more realistic, I export the mesh to .x file and load it using DirectX 9 and C++, the problem is that I don't see the specular level that I have applied in 3Ds Max.

How can I load .x file in DirectX 9/C++ with specular level according to the material applied in 3Ds Max?

[attachment=12651:0.png]

Share this post


Link to post
Share on other sites
Advertisement
Are you rendering the mesh using a custom shader? Does your shader support specular highlites?

Cheers!

Share this post


Link to post
Share on other sites
Well have you enabled specular highlights for your rendering? Ie. setting D3DRS_SPECULARENABLE to true?

You don't give much of information about the rendering code so this is just guessing.

Cheers! Edited by kauna

Share this post


Link to post
Share on other sites
No, I was not setting D3DRS_SPECULARENABLE to true, now I tried to set it to true by using:
device->SetRenderState(D3DRS_SPECULARENABLE, TRUE);

but still no specular. Edited by Medo3337

Share this post


Link to post
Share on other sites
I'm not creating any light using DirectX, I'm just using 3Ds Max to set the specular level as you see in the above screenshot, then I use the following code to render the mesh after loading the mesh from .x file:


device->SetRenderState( D3DRS_LIGHTING, TRUE );
device->SetRenderState( D3DRS_SPECULARENABLE, TRUE );
device->SetRenderState( D3DRS_SPECULARMATERIALSOURCE, D3DMCS_MATERIAL );
// Code to draw the mesh here...

Share this post


Link to post
Share on other sites
Well is there a light source in the scene? Does your diffuse lighting work as intended?

Can you confirm that the exported x-file contains lights and that your rendering code sets the lights?

A screenshot of your program with the model would help also.

Cheers! Edited by kauna

Share this post


Link to post
Share on other sites
In 3Ds Max, I'm only changing Specular level value, I don't add any other light, when I load the .x file into DirectX Viewer, I don't see the specular as well, I'm trying to use Panda DirectX Exporter to export from 3Ds Max, I'm not sure if it export information about the specular level that I set in the material window. Edited by Medo3337

Share this post


Link to post
Share on other sites
ive never tried adding specular in 3dsmax to a mesh, but i know how to add a specular on a model with .fx which gives off a nice effect like this

tinyspec.jpg Edited by Anddos

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!