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 / My objects are totally black on the other side of the main ambient light source

Author
Message
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Sep 2010 09:50
How can i set it so the dark side of objects are for example just 50% darker than the lit side? Or even adjust the darker sides color to make it a kinda slightly blueish dark.

I've experimented with quite a few commands regarding this, but in 99% of cases nothing happened because of them...
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 8th Sep 2010 11:59
Ambient light doesn't have a source and therefore doesn't have a 'other side'. It is just a value that is added to all geometry to increase the light uniformly.

To achieve the effect you are wanting, I would suggest turning ambient light very low or even off, then using two directional lights instead.



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Sep 2010 14:14
Surely ambient light is all you need?

The following code works perfectly for me:



The lighting in the demo consists of a red light from the left and a green ambient light, so parts of the sphere that get full ambient (100%) and full red light appear yellow. Other parts will appear various shades of green, yellow, orange or red depending on their position and the level of the ambient light. The ambient level starts at 50% and you can increase/decrease it using up/down keys.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Sep 2010 14:19
I think it's more effective to set the ambient light colour and level for specific objects - seemed to get better results that way than setting the 'global' ambient colour. That was a while ago however, maybe it was a bug that got fixed.

Either way, the ambient light should do exactly what you need, whichever way you apply it.

Health, Ammo, and bacon and eggs!
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Sep 2010 14:25
I couldn't really know how to call it, it seems to me that there is a directional light from a random but fix direction and there should be an ambient light which isn't really present here with me no matter how hard i try to see it... so i called that directional main light ambient.

Just wanted to clear this, now onto your suggestions, gonna let you know how it worked.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Sep 2010 15:11
ohh-shi.. sorry guys i left a Fade object command in the code, it was there from the very beginning, and kinda deactivated everything i wanted to change the light behavior of my character with.

However i still can't find the correct adjustments to ease the shadows, it is so sharp it ridiculously shows each and every polygons in the model changing from light to dark as it turns... is there a basic combination of these 'set light' commands to make the changing from light to darker soft?

I remember this wasn't always like this, back in the Classic days when i created a sphere it was nicely shaded, now its this sharp for some reason.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Sep 2010 15:12
I think you are getting confused between ambient light which lights in every direction, and the default directional light 0 which is automatically created for you and shines from behind and down when the camera is in it's initial position/rotation.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Sep 2010 15:22
Quote: "However i still can't find the correct adjustments to ease the shadows, it is so sharp it ridiculously shows each and every polygons in the model changing from light to dark as it turns... is there a basic combination of these 'set light' commands to make the changing from light to darker soft?"


That sounds like a completely different problem, faceting perhaps? I think we need to see a simple demo so we are all on the same wavelength.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Sep 2010 15:33
SET OBJECT SMOOTHING Obj,Percentage

Try values like 90 for the percentage.

This should smooth out the polygons, but you should really try and fix it in a modelling app - this tends to be caused by unwelded vertices, or unsmoothed normals. It's best to have full control, so you can choose how sharp or smooth the edges are on different parts of the model.

Health, Ammo, and bacon and eggs!
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Sep 2010 15:34
No, the object is smoothed correctly. Not THAT big problem like if the faces weren't welded or something, but still very ugly this way.

There is just ALMOST only two phases of lighting right now, light, and dark... where is the transition between them... it is there, but VERY little, like there is the lighted part, then the transition, and then dark, i could illustrate this like 49%-2%-49% however it should be 33% each in my opinion.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Sep 2010 15:49
Post a simple demo - or a screenshot at the very least. At the moment none us really know what the problem is.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Sep 2010 16:12
I mean this.

See how ugly the left one, and how it should look in my opinion...
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 8th Sep 2010 16:28
Using a higher-poly model should fix that. The issue you see there is that DBP uses vertex lighting. More vertices = smoother lighting but lower FPS. If you're using the MAKE OBJECT SPHERE command then you can subdivide it by adding 2 extra #s to the command, i.e.:

MAKE OBJECT SPHERE obj,size,rows,columns

Quick example:


Alternatively, you could use a shader.


Guns, cinematics, stealth, items and more!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Sep 2010 16:42
I agree.

Login to post a reply

Server time is: 2026-07-24 23:11:58
Your offset time is: 2026-07-24 23:11:58