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 / More Lights

Author
Message
Syndu
17
Years of Service
User Offline
Joined: 1st Nov 2006
Location:
Posted: 25th Mar 2009 00:54
I am working on a space simulation project and had planned on using DarkGDK lights as stars. This worked perfect in my First run test and created a great look to the planets the light cast on. However I now realize I need 12 "suns" and was wondering if it's possible to have more then 8 lights.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 25th Mar 2009 11:57
If you want more than 8 active lights then use shaders. But what kind of a solar system has 8 stars?

Syndu
17
Years of Service
User Offline
Joined: 1st Nov 2006
Location:
Posted: 25th Mar 2009 18:22
I'm new to shaders but reading the description of Dark Shader it still only talks about 8 light sources. I don't just need an object that "glows" i need it to project light on objects around it.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 2nd Apr 2009 10:58
I don't think you see all 8 lights at the same time. Just reposition the lights that you don't see.
G0DL355
15
Years of Service
User Offline
Joined: 12th Dec 2008
Location: Between Realities...
Posted: 2nd Apr 2009 17:21
Like darkcoder said, maybe instead of using light sources for the stars, use shaders to create light-emmissive objects in their place.

I think there's a limit on how many emmissive objects you can have, and, again, I'm not sure how many this is, or even if it's the same amount as GDK lights, but experimenting might not be a bad idea.

As to adapting the lights to some hide or turn off when they're not in the viewable screen area, I feel might be a bit long-winded to code...

--------------
So Endeth What Was Begotten From That Moste Darkest and Forgotten Of Times...
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 2nd Apr 2009 17:34
There is no limit to how many lights you can have in a shader purely because lights are an abstract concept, you don't 'create' lights in a shader, you just do some computation to change the colours of the pixels and you can draw a line anywhere saying this is now lit or it isn't. If you want to use basic independently moveable point lights then the limit of how many you can create is almost unlimited, as you can store an array of light positions and just loop through it. However, GDK doesn't support reading/writing of array constants and you have no access to the shaders(the D3D effect itself) once they're loaded so the limit is down to how many instructions and shader constants you can create. Nevertheless, the limit for such lights in GDK using a shader is above 8, I've written one for someone using at least 12 lights(mix of point and directional). But keep in mind that just because you can create lots of lights you shouldn't, unless it's absolutely necessary; lots of lights means lots of computation, if these objects or light sources never move around then that's a total waste as you could have precomputed the lighting into textures.

Login to post a reply

Server time is: 2024-09-30 21:21:11
Your offset time is: 2024-09-30 21:21:11