Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / 3D model question - might be related

Years of Service
User Offline
Joined: 19th Feb 2008
Posted: 16th Jun 2011 14:28

This question might be better to ask in the 3d chat board...

I have a model that I exported form Blender 3D... when I load it into it is dark, seems to have no light at all. Notice this sphere next to it with the same texture.

I loaded the same object in 3D object viewer... an app I got from the programs board... i think it was made with dark basic. The lighting on the object seems fine.

Any ideas what might be causing the object to loose light level? Can I set it? It might be a blender export issue, in which case i can post on the 3d chat forum... just checking if any knows about this kind of thing
Mr Bigglesworth
Years of Service
User Offline
Joined: 4th Mar 2008
Posted: 30th Jun 2011 06:11
It's probably a Blender export issue, I have seen many people on this forum having trouble using .X files exported from blender. I would try finding another .X exporter for Blender and trying it.
Retired Moderator
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 2nd Jul 2011 19:48 Edited at: 2nd Jul 2011 19:49
Also, it could be that the face normals are reversed which causes the lighting to be completely reversed. Are there export options to change the face normal exporting?

(EDIT) By face normals, I mean, this could be the order in which triangle vertices are ordered.


Chris Tate
DBPro Master
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 3rd Jul 2011 15:32 Edited at: 3rd Jul 2011 15:41
Hi all

The normals; the polygon directions; in your model will need to be calculated using the [SetObjectNormals] function. What you are looking at is an object with its normals all set as equal by the Blender script.

As you can see, the engine generated sphere is lit differently to the Blender 2.5 3D model in .X format. This example is the result of the following test VB.NET GDK code:

and, the following Blender Script.

The next screenshot demonstrates how the same model looks with its normals calculated [odb3d.SetObjectNormals()]:

Somewhat better...

However, there would be less runtime processing if the Blender Script calculated the normals correctly. As you can see from this Direct X viewer that comes with the DirectX SDK, the lighting is looking rather ugly...

Here is the model loaded in DBPRO

The above example is from the following code without the set object normals function call

DBPRO solution with normals calculated

Using a more pronounced lighting environment, we can show that the texture on the Blender model is being shaded per light source; once the set object normals function call has been used.

Please let us know how you get on and if this solves the problem

Years of Service
User Offline
Joined: 19th Feb 2008
Posted: 4th Jul 2011 11:04
WOW, thanks for the help everyone, this is great. I got around it but turning the object lighting off, which is not really the right solution. But these posts made all the difference.
Very helpful, because blender is a great modeling package, especially for game level design. I have found True Space's .x converter to work better, but I much prefer blender to True Space.

Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 30th Jul 2011 05:07 Edited at: 1st Aug 2011 03:28
I'm having the EXACT same problem. In fact, my model is CREATED in DBPro, and saved as an .x file. It looks fine in DBPro, but is all black in I must add, there is no texture. But I have a dgdk cube loaded with no texture, and it gets lit. Trying myMesh.GenerateObjectNormals() does nothing.

I loaded my model in Ultimate Unwrap, and simply added a texture to it. I then exported it as a DX9 .x file, and made sure I exported the model with a texture. It didn't matter that I did not have a texture in the directory, it now loads the model with the correct shading minus texture. I think the .x file just needs a reference to a texture, thats what probably inits the lighting.
In fact, I bet if I go back to the DBPro app that created the mesh in the first place, and just add a texture there, it will probably save it correctly. Anyway, all is well now.

Login to post a reply

Server time is: 2023-12-01 22:39:04
Your offset time is: 2023-12-01 22:39:04