• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Medo Mex

Loading Mesh with Specular Level

36 posts in this topic

In the D3D9 lighting equation, the materials specular value is multiplied with the lights specular value so if either of them is black, you don't get any specular effect.

The lighting is up to you to decide. Typically, a directional light is used to give lighting effect of a distant light source such as sun or moon.

Since it is a directional light, the position doesn't have any effect on the lighting. So practically you don't need to touch the lights position when the player is moving.

Otherwise, a directional light source isn't the best way to light indoor environments, it works the best at outdoors.

Best regards!
1

Share this post


Link to post
Share on other sites
Very good info! I thought that the sun light is a point light.

I'm trying to make each mesh specular level same as in 3Ds Max, so I tried putting some values, but couldn't get it to work, I have the mesh specular level set to 20 in 3Ds Max, I thought I could give light.Specular (1.0f, 1.0f, 1.0f) so when it get multiplied the result become the same as the specular level in the mesh.

As you can see in the screenshot, the specular level is too high even I'm setting it's value in 3Ds Max to 20 only.

I would appreciate if you could tell me how can I change this code to get a result at least close to the value that I put in 3Ds Max to the specular level.

[CODE]
D3DLIGHT9 light;
ZeroMemory(&light, sizeof(light));
light.Type = D3DLIGHT_DIRECTIONAL;
light.Diffuse.r = 0.1f;
light.Diffuse.g = 0.1f;
light.Diffuse.b = 0.1f;


light.Specular.r = 1.0f;
light.Specular.g = 1.0f;
light.Specular.b = 1.0f;

light.Ambient.r = 0.1f;
light.Ambient.g = 0.1f;
light.Ambient.b = 0.1f;


// Set the direction that this light will generate light from
D3DXVECTOR3 vDir( 100.0f, -100.0f, 100.0f );


// Normalize the light direction
D3DXVec3Normalize ((D3DXVECTOR3*) &light.Direction, &vDir);
[/CODE] Edited by Medo3337
0

Share this post


Link to post
Share on other sites
Can you provide a screenshot of 3DS MAX to give some reference about the image?

There is a possibility that 3DS MAX is using per-pixel lighting for the preview screen which gives more accurate specular high lights.

I think that you should also increase the lights diffuse value. Typically most of lighting comes from the diffuse part of the lighting equation.

Yes, sun could be modeled with point light, but then it's relative position to the scene needs to be quite far (which is true in the real world too).
As the point light source gets further and further away, the light direction starts to get uniform. For that reason, a directional light is used often to model sun light. It could be considered as optimization, since directional lights can skip attenuation calculations and the light direction vector is same for all position on screen. The attenuation difference between the closest and the farthest point of earth to the sun is quite small.

A point light needs to calculate the light direction vector and attenuation for each fragment / vertex.

Best regards!
0

Share this post


Link to post
Share on other sites
Your light source definetely lacks diffuse lighting component. Otherwise, you'll need to get exactly the same point of view to compare the specular component, since it is view point relative.

To achieve the quality of a rendered 3DS MAX image may not be possible with D3D9 fixed function pipeline.

Best regards!
0

Share this post


Link to post
Share on other sites
I have update my exporter today because I found glossiness in 3ds max is the power, not the specular level... so if you want to ajust power, please redownload the plugin.
Now the power/glossiness you get is beteen 0 to 100, just what you see in 3ds max.
0

Share this post


Link to post
Share on other sites
@Alin: I don't see the update, I downloaded v1.8.2 few days ago and on the website I still see the same version http://www.cgdev.net/download.php

Additionally, I have few suggestions:
- I would suggest you to make "Add animation" open a new window to add animation instead of editing from the animation list, when I double click on the animation item to edit it, it's not showing edit mode easily.

- When you change the settings in the export window, it doesn't save which waste alot of time later when you try to export again since you have to add the same settings again including animations, etc...

- A progress bar while writing the .x file would be great.

- Hitting 'Enter' button to start exporting would be better. Edited by Medo3337
0

Share this post


Link to post
Share on other sites
I dont change the version v1.8.2 to v1.8.3 because this version simply change back to export glossiness as specular power... so your download 3 days ago is a special build for you. The next version I will add support for saving the settings of animations.
Thanks for your feedback
0

Share this post


Link to post
Share on other sites
@Alin: It looks like there is a bug with your exporter, I tried Panda Exporter and it's working perfectly with the specular effect, but had troubles with your exporter, when I set the specular level to 10 (As you see in the attached screenshot) I see a very high specular level when I use your exporter while when I use Panda exporter it's working perfectly.

Also, when I don't use specular in 3Ds Max and export the mesh with your exporter, I still see specular effect in the program even I didn't set it in Max, while when I use Panda Exporter it's not showing specular effect which is the accurate result.

The attached pictures show the same mesh with the same specular level and same everything, the only difference is the exporter.
0

Share this post


Link to post
Share on other sites
Thanks for your feedback, I have just released v1.8.3 for this bug. The new version also support saving settings of animation list.
0

Share this post


Link to post
Share on other sites
@Alin: Thanks for your cooperation!

One thing you might need to correct: Hitting 'Enter' on the keyboard doesn't start exporting.

I also would like to thank kauna for helping me to resolve this issue.
0

Share this post


Link to post
Share on other sites
Wow

what a long repies...

Max's spec level is just a float 100% is 1 ..

You must multiply it to specular value..

I tested it with my own software renderer 15years ago ^^

I can't help about X file's structure but I hope my knowledge help to writing shader :)

happy days Edited by GeniusPooh
0

Share this post


Link to post
Share on other sites

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  
Followers 0