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 / Creating a sun

Author
Message
Jenilee
14
Years of Service
User Offline
Joined: 25th May 2010
Location:
Posted: 25th May 2010 10:35
I would like to create a sun. Creating a sphere is easy enough, and so is a light, but how can I make my sphere emit light?
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 26th May 2010 12:12
Only a light can 'emit' light

You can set the sphere (or any object) to be illuminated despite of the light sources, for example:

dbSetObjectLight ( obj_id, 0 );
dbSetObjectAmbient ( obj_id, 0 );

For a basic sun effect, you can set a ghosted billboarded plane (a plane that always point to the camera), with a sun glow texture, in the position of the sphere, to give a sense of fake light emission.

Then set a light inside the sun sphere to light other objects.

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 26th May 2010 15:05 Edited at: 26th May 2010 15:05
i never tried this, but maybe you should use a plain with a texture ( and alpha channel (transparency) ) to be the sun, and place a light in front of it, with high range and strength, i dont think creating a sphere to be a sun is a good idea, but well, once again, i didnt try

[EDIT] sorry if that is just what morcilla said, i didnt read the post

Login to post a reply

Server time is: 2024-07-07 00:10:03
Your offset time is: 2024-07-07 00:10:03