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.

AppGameKit Classic Chat / createlightPoint working?

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th Apr 2013 02:22
I can't get createlightPoint working.
No matter what I do it sheds full light.

createlightPoint(1,0,0,-100,10,255,255,255)

This is 100 behind the camera with a range of 10, yet everything in front of the camera is fully lit.
I have SetObjectLightMode() switched on and there are no other lights present.

This is 1088.

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 14th Apr 2013 03:35
Oh yes, I see that it's not working in other threads. This has been broken for quite a while. Is it going to be fixed for 108 final?

I see that the directional light is pretty useless too - can't darken the scene much at all.

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 14th Apr 2013 09:47 Edited at: 14th Apr 2013 09:49
It works fine, are you using "SetObjectLightMode(ObjID, 1)" ?

You need both lights for the built in shader to work also, so create a directional light with 0, 0, 0 vectors if you don't want the light from that to interfere with the point light. Or load your own shader without directional light

My hovercraft is full of eels
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 14th Apr 2013 13:17
You also nead to set an inzane size of the light Point

Set radius 3000-6000 to see easier wath i mean.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 14th Apr 2013 14:08
Quote: "You also nead to set an inzane size of the light Point

Set radius 3000-6000 to see easier wath i mean."


If that was the issue nothing would be lit. Those numbers depend on the scale you work on, but yes they don't match the camera distance scale. Seems like you need at least 10x the camera/object distance for a point light radius

My hovercraft is full of eels
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Apr 2013 19:35
The radius isn't in world units, it is a parameter into a quadratic fall off calculation so whilst larger values will extend the range of the light it isn't calibrated to the 3D world.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Apr 2013 20:41
Also the max radius is different on android compared to windows. I started a project with, shall we say, slightly wrong scale, and the radius had to be 100000 to do the job. While that worked on windows the ball of light was cut short on android. But the scale was really off on my 3d world

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Apr 2013 22:44
Quote: "The radius isn't in world units, it is a parameter into a quadratic fall off calculation so whilst larger values will extend the range of the light it isn't calibrated to the 3D world."

What does that mean in layman's terms, assuming someone didn't understand what you mean? Not me... I understand perfectly... honest...

Perhaps if radius was a world value that would be better? Or is it simpler than it sounds?


this.mess = abs(sin(times#))
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Apr 2013 23:43
Quote: "What does that mean in layman's terms, assuming someone didn't understand what you mean? Not me... I understand perfectly... honest...

Perhaps if radius was a world value that would be better? Or is it simpler than it sounds?"

I also nead an explanation as i nead an large radius and could throw of my Project completely?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 18th Apr 2013 00:07 Edited at: 18th Apr 2013 00:08
Quote: "What does that mean in layman's terms, assuming someone didn't understand what you mean? Not me... I understand perfectly... honest...

Perhaps if radius was a world value that would be better? Or is it simpler than it sounds?"


I believe that means that the fall off calculation (gradient diminishing of light that matches real world light attenuation) could be a calculation that better matches world values if it's calibrated.

Maybe by running some tests to see where the gradient of the point light ends in world position at different radius', then adding a sort of offset in the shader so that the radius value better matches world position. Or summink

My hovercraft is full of eels
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 18th Apr 2013 01:52
The falloff calculation works out how much light a surface receives based on its distance from the light. Quadratic falloff mimics reality where if you double the distance from the light the amount of light the surface receives is one quarter, if you quadruple the distance the light is one sixteenth, and so on.

As such there is no distance where the received light actually drops to zero, assuming we were using floating point values in our calculation the received light would just get closer and closer to zero. Of course using integers (0-255) we reach a cut off point but that could be very far away from the light source. As such the radius value doesn't really represent the limit of the light.

I've had a look at the calculation and the radius value equals the distance of maximum illumination, squared. For example a radius of 16 (4 squared) means that any objects within 4 world units would receive a full light value of 255, anything closer is capped to 255, and anything further away receives less light. An object 8 units away from the light would receive a quarter of the light.

Another example, a radius of 100 (10 squared) would mean that anything within 10 world units gets full light, and something 20 units away would receive a quarter of the light.

Linear falloff is a lot easier to understand, at zero the light is full, and at some radius the light is zero, and it reduces in a straight line from full to zero. But it doesn't produce realistic lighting.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Apr 2013 10:57
So perhaps to make it 'easier' to understand for dumb shmucks like me, instead of calling it "radius" we should call it "squareOfQuadraticFallOffStartRadius"?



I think a better explanation in the help would probably suffice, we monkeys need signs that point to the bananas


this.mess = abs(sin(times#))
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 18th Apr 2013 16:46
Quote: "So perhaps to make it 'easier' to understand for dumb shmucks like me, instead of calling it "radius" we should call it "squareOfQuadraticFallOffStartRadius"?"


Or just call it brightness

My hovercraft is full of eels
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Apr 2013 16:48
That's catchy


this.mess = abs(sin(times#))

Login to post a reply

Server time is: 2024-05-03 22:55:18
Your offset time is: 2024-05-03 22:55:18