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.

DarkBASIC Professional Discussion / Blender Model Lighting Problem

Author
Message
Heftig
16
Years of Service
User Offline
Joined: 13th Jul 2010
Location:
Posted: 13th Jul 2010 18:27
Greetings to TGC community, I hope this message finds you well.

Ok I'm having a problem with models exported in .X format (from Blender) and the light that they recieve from DBPro lights, and I'm hoping one of you might 'shed some light' on my problem (someone stop me from hurting myself).

First, let me tell you about the models, they are UV mapped (in blender),they have been combined into a single mesh and bone-animated (again in blender). They have textures applied to them in blender and I also tried applying texture to them in DBPro, the same result for both methods.

Now, the light recieved by said models is not colored, no matter what color I make the light, it's all white (weally though it's not all wight, I'm quite fwustwated at the cuwwent state of affairs). And when I set object diffuse to try to color the light, it gets worse; the light turns so bright it obscures the texture beneath it, still white, and even when I set the diffuse
to 0's.

I uploaded some pics to help explain a little bit clearer.

Does this issue sound at all familiar to any of you? If so, are there any pointers or guidelines that you could share with me? I appreciate any help I might get, but understand if I am left 'in the dark' (double pun! no 'lights' in 'Dark' Basic! ROFL) then I'll just have to find a work-around.

Anyway thanks for reading and good luck to you all, I hope to hear
from somebody soon. Bye
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 13th Jul 2010 21:39
hm, I've never encountered that with any of my models exported from blender, could I see the code?


Heftig
16
Years of Service
User Offline
Joined: 13th Jul 2010
Location:
Posted: 13th Jul 2010 22:09
Thanks for the quick reply

[/code
` Spearman
global Spearman_Idle=3
load object "models/Militia_b_Wrk.x",Cache(Spearman_Idle)
load image "models/MilitiaTex_A.png",Cache(Spearman_Idle)
texture object Cache(Spearman_Idle),0,Cache(Spearman_Idle)
rotate object Cache(Spearman_Idle),0,180,0
fix object pivot Cache(Spearman_Idle)
set object cull Cache(Spearman_Idle),0
set object light Cache(Spearman_Idle),0
scale object Cache(Spearman_Idle),400,400,400
hide object Cache(Spearman_Idle)
set object interpolation Cache(Spearman_Idle),50
set object speed Cache(Spearman_Idle),25
loop object Cache(Spearman_Idle),0,40
]

Then I Instance copies of this object (useing the Cache() array as reference) wherever I need them. I don't give and light-related commandes (or even texture related commands) to the Instanced copy.
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 14th Jul 2010 01:19
well, by the looks of that code, you are making the object not be affected by any light with set object light Cache(Spearman_Idle),0, so then its always just affected by the default lighting. try taking that line out...


Heftig
16
Years of Service
User Offline
Joined: 13th Jul 2010
Location:
Posted: 14th Jul 2010 03:55
Ok sorry, when I made those screens that I had uploaded that line was Rem'ed out, sorry about that, I've been switching the lights in and out (during tests that I was running with one of Evolved's shaders) and I guess I forgot to remove that line before I copy-pasted the code for you, my bad. During the lighting tests with native DBPro lights that line wasn't there. But thanks for the pointer anyways hehe.
GeeBee
17
Years of Service
User Offline
Joined: 26th Aug 2008
Location:
Posted: 14th Jul 2010 16:22
Looks v similar to a problem I had also. I never fully identified the source of the problem, but did resolve it. For me the solution was at model source - ie Blender. Sadly it involved a process of 'try anything and everything', so I can't remember all my approaches. Check the following in Blender:

1. Excess vertices? Select each limb in turn, enter edit mode, select all vertices and find the "Remove excess/duplicate Vertices" (or similar command - I'm away from own computer). My model had duplicate meshes for some reason.

2. Check for stray vertices (delete) or merge ones that are so close that they are effectively a single point. Good for model file size reduction if nothing else.

3. If the above doesn't help, 'Un-child' any limbs (if applicable) then try 1&2 again, then re-parent. I've formed an opinion that some Blender commands only seem to work when the object is at 'top level'. I don't know how bone animation works so you will have to judge for yourself what to do on that one.

4. See if any unwanted texturing/materials have sneaked in & remove them. I know my current (successful) model is only using its UV map. However I am pretty sure this was my first approach which I actually tested seperately and it hadn't made any difference.

5. Finally, but possibly the one you really won't like, is re-modelling from scatch. I know on one model I had a single limb that continued with this problem (bit like your 'brown haired fellow's body in the pic?). Re-modelling & UV mapping from scratch (not duplicating) did the business.

My models were only 'simple' (human character/Helicopter) with frame animation - no bone animation like yours.

Any help?

The simplest misteaks are the hardest to spot.
Heftig
16
Years of Service
User Offline
Joined: 13th Jul 2010
Location:
Posted: 14th Jul 2010 22:47 Edited at: 15th Jul 2010 05:38
Huzzah! Thank you GeeBee!

I tried the easiest solution first; stripping the baked in texture from blender, then applied the texture image to the object in DBPro and viola! The texture recieved colored lights, and accepted the diffuse lighting settings with no problems.

This will mean alot to me and my projects, thanks a ton friend.

For anyone else's benefit:
Rule of thumb is: No applied textures exported from blender, use them for generating UV maps but remove all images from the model before exporting, re-apply images in DBPro using texturing commands. If that helps anyone else then great

Thanks again GeeBee. Bye and good luck
Heftig
16
Years of Service
User Offline
Joined: 13th Jul 2010
Location:
Posted: 15th Jul 2010 05:39
" The simplest mistakes are the hardest to spot "

Loved your signature by the way.

Login to post a reply

Server time is: 2026-07-25 03:25:43
Your offset time is: 2026-07-25 03:25:43