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 Discussion / Shadows...

Author
Message
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 15th Jul 2008 23:51
I have a very basic scene set up, here:



Shouldn't there be a shadow on the cube? Am I doing something wrong? There's an example program where Lee appears to make shadows out of lights. Does it only work on matrices? Thanks.


"Bonjoo!"
A quote from Taylor Quinton Velvety Cummings.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Jul 2008 04:13 Edited at: 31st Jul 2008 05:05
Hello,

well, there's a couple of things going on. What version of DBC are you using? 1.20 has some material settings that influence how light behaves.

Shadows are never "cast" per se in DBC. Even if you have an object that should be blocking the light source. In the matrix example you reference, I believe there is a light object created that can be referred to as a dark light. That's a light where the color values are set to negative rgb(-255,-255,-255). What this does is instead of casting light as the color, it absorbs light of the color. The dark light is what you are seeing in the example.

Now, as far as the cube... to make more convincing lighting effects, it's up to the normals of an object. A normal is calculated per polygon and then per vertex. That means, the more polygons, the better the lighting will look. A DBC cube only has 2 polygons per side so the lighting is pretty limited as opposed to a matrix which has many polygons so the subtleties of the lighting are more promounced.

Here's a rewrite of your example. I did it in DBC 1.20. It runs a little darker in 1.13. I've attached a cube that comes in the example files in case you don't have it. It has many polygons.



Enjoy your day.

Attachments

Login to view attachments
KYP
20
Years of Service
User Offline
Joined: 5th May 2005
Location: 01110000
Posted: 16th Jul 2008 04:54
Thanks Latch. I was way off That works perfectly (no surprise there)


"Bonjoo!"
A quote from Taylor Quinton Velvety Cummings.

Login to post a reply

Server time is: 2025-06-07 07:07:54
Your offset time is: 2025-06-07 07:07:54