|
shade-c evo flashlight
#438962
03/24/14 16:39
03/24/14 16:39
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
I know how to create lights ect.. But I don`t know how to move lights (in while loop) What I meen:
sc_light_create(vector(camera.x, camera.y, camera.z), 1000, vector(25,25,25), SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW , vector(camera.pan, camera.tilt, camera.roll), 90);
This creates a light. I can`t put it in a while loop, otherwise it would constantly create lights and kill my fps. Is there a way to set shade-c lights to moving objects without killing fps? Random
|
|
|
Re: shade-c evo flashlight
[Re: Random]
#438965
03/24/14 17:57
03/24/14 17:57
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
a guess: this function returns the light entity which you can move around. if guess #1 is true: guess #2: shadomapping depth-views are updated automatically so just moving around the light entity should work
POTATO-MAN saves the day! - Random
|
|
|
Re: shade-c evo flashlight
[Re: Random]
#438967
03/24/14 18:48
03/24/14 18:48
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
I know how to create lights ect.. But I don`t know how to move lights (in while loop) What I meen:
sc_light_create(vector(camera.x, camera.y, camera.z), 1000, vector(25,25,25), SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW , vector(camera.pan, camera.tilt, camera.roll), 90);
This creates a light. I can`t put it in a while loop, otherwise it would constantly create lights and kill my fps. Is there a way to set shade-c lights to moving objects without killing fps? Random You need pointer of this function to work in a while loop like this:
ENTITY* spotlight1 = sc_light_create(vector(camera.x, camera.y, camera.z), 1000, vector(25,25,25), SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW , vector(0, -45, 0), 90);
while(1)
{
spotlight1.pan += time_step*.5;
//update the spotlight
sc_light_update(spotlight1);
wait(1);
}
|
|
|
Re: shade-c evo flashlight
[Re: rojart]
#439095
03/26/14 18:24
03/26/14 18:24
|
Joined: Feb 2010
Posts: 886
Random
OP
User
|
OP
User
Joined: Feb 2010
Posts: 886
|
Perfect! It is smooth and I have no preformens loses.
|
|
|
|