Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Getting dynamic lights to work

maddogx
Registered User
Quote
2012-02-26 21:32:22

Hi there,

been a while since I last posted here.

I recently decided to check out the current status of copperlicht and was pleasently surprised to see that dynamic lights have been added. So after taking the time to update my old project to work with the current engine, I decided to try adding a dynamic light to my scene.

What I did:

- Created a LightSceneNode and attached it to an object SceneNode via addChild, so that the light is about 50 units outside of the object geometry.
- Set the Lighting value in the object matierial to true.

The result:

The object is rendered black, no lighting at all. I've tried reducing the attenuation on the light source and increasing the radius, but to no effect.

Presumably I am missing some important step?


EDIT: on a side note, is it possible to render the scene with a transparent background (so that HTML in the background is visible)? I've tried setting the background color of the scene to 0,0,0,0 (ARGB), but it still remains opaque black.


niko
Moderator
Quote
2012-02-27 21:56:03

Hm, strange, it should work that way. Maybe the color of the light hasn't been set yet and it is simply black? try something like r.Color.R = 1.0;


maddogx
Registered User
Quote
2012-02-28 10:22:08

Nope, Firebug shows the light color as A:1, R:1, G:1, B:1 - and setting it manually doesn't help.

I'm in the process of creating a minimal scene to see if I can troubleshoot the problem more easily, or otherwise upload it somewhere in the hope that you can help me.

I have to point out that I am creating my scene manually, not using CopperCube, so I guess the source of the issue might lie with the way I am creating my meshes (mostly spheres), for example.


maddogx
Registered User
Quote
2012-02-28 15:16:53

eMail with attached test scene sent. (Hopefully it won't get blocked by a spam filter or something.)

Basically it's a scene with a light and a box with the camera rotating around it. The box should normally be affected by the light, but it isn't.


maddogx
Registered User
Quote
2012-02-28 20:12:25

Okay, I figured it out. I wasn't normalizing my vertexes. Works now. :)

Still my last question remains: is it possible to render against a transparent background?


niko
Moderator
Quote
2012-02-29 06:52:37

D'oh, I just debugged your program and came to the same result :)
No, transparent background isn't possible, sorry.


maddogx
Registered User
Quote
2012-02-29 07:36:01

That's too bad. Oh well, at least I have the lighting issue sorted out - mostly. Of course now I have to figure out how to write a per pixel lighting shader, because the shadows on my spheres look less than appealing with per-vertex lighting. ;)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact