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 / Dark models while using shaders?

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 5th Sep 2011 08:36
Hi all,

So I've started using shaders in my DBpro games for the first time, but some of the models I bring in are now turning out REALLY dark for some reason, whereas when not using shaders they look fine. After playing around, I have a feeling it has something to do with the smoothing groups on the 3D models. I'm using 3ds Max​ and after isolating areas of the model and applying separate smoothing groups I sometimes get good results and other times don't... Has anyone got some insight on what I can do to help this problem?

Thanks in advance. I asked this on the 3D talk forum but I think it was the wrong crowd to ask...

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 5th Sep 2011 10:23
That sounds like there may be a problem with the model's vertex normals, is this the problem I noticed with the door frame in your lighting test demo?
I don't use Max myself so I cant offer much, but what format are you exporting to? If you are using .3ds, could you export to .x (or vice-versa).
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 5th Sep 2011 10:51
Hi again, Revenant. You're fast becoming my go-to shader guru! Sorry about that!

No, the problem with the door in the demo I sent was that it had no texture and didn't have any effects applied to it

With this problem, I can see the model's texture, but it's just very, very dark. A couple of the models I've done some fiddling with (re-modelled it a different way, for example) and it's come up fine, but I'm not sure precisely what the issue is. I've tried exporting the models as .X files but I get the same result.

I might play around with the vertex normals. You may be onto something. If I get results I'll post here.

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Sep 2011 13:41
Quote: "I've tried exporting the models as .X files but I get the same result."


If you export them as text X files you can simply inspect the file using a text editor. My guess is the same as revenant chaos's - check the normals. A possible issue is the "winding order" of the vertices in the polys in question, but I'd look at the normals first.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Sep 2011 14:05
Or you could make sure that the model is welded properly. You may have detached points.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 5th Sep 2011 16:38
Checked the normals, checked the welds. Still have the problem. Very strange...
I haven't fully ruled out that it's not the textures... I'll look into that and get back to you guys.

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Stab in the Dark software
Valued Member
23
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 5th Sep 2011 18:49 Edited at: 6th Sep 2011 04:47
CumQuaT

Try using the DBPro command “Set Object Normals” after you load the object. Then make sure you call the DBPro command “Set Normalization On” just before the Do/Loop. You can also toggle “Set Normalization On” in the Do/Loop by using “Set Normalization Off” to see the effect while your code is running.


[img][/img]


WindowsXP SP1,Vista,Windows 7 DBpro v7.61
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Sep 2011 00:33
Stab in the Dark software

Good point - especially if the model is being scaled after loading.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 6th Sep 2011 03:05
A very good point! I'll try that out when I get home tonight and report back to you gentlemen!

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 6th Sep 2011 16:11
Hmm... Still no joy.

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Sep 2011 18:15
Could you post a simple X file version of a model plus media that shows the problem? We might be able to spot something then.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 10th Sep 2011 15:55
Sorry for the delay guys... My hot water cylinder decided it wanted to explode violently, flooding the house with 250L of water... All over my newly laid carpet...


Anyway, I ended up fixing the problem by converting the file to .DBO

Whatever it does in the conversion process, it seemed to work!

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Sep 2011 16:59 Edited at: 10th Sep 2011 16:59
Quote: "My hot water cylinder decided it wanted to explode violently, flooding the house with 250L of water... All over my newly laid carpet"


That sort of thing is infuriating. Hope you got it sorted out OK.

Quote: "Whatever it does in the conversion process, it seemed to work!"


That is weird. Glad it solved the problem.

Login to post a reply

Server time is: 2026-07-10 20:11:32
Your offset time is: 2026-07-10 20:11:32