Light Color blowing out on meshes

BlitzMax Forums/MiniB3D Module/Light Color blowing out on meshes

North(Posted 2007) [#1]
Hi there,

again sorry if this topic rather belongs into the B3D forums but since i'm new to miniB3D aswell as B3D i have a hard time sparating issues that work as intended from possible oddities in MiniB3D as it is in development.

So currently i am wondering why a mesh that is lit by a point-light with color(255,0,0) blows out to complete white on the light-facing triangles, uses the light color to fade to black on the backside.
In my opinion the lightcolor should be reflected by the mesh. This likely has to do with the material being used on the mesh, too. I disabled specular and tried lowering the color values for the light but neither worked.
As a last resort i changed the entitycolor of the mesh to the same level as the light wich works visually but in my opinion should not be nescessary.

Here an example(hope it shows):



So could somebody fill me in regarding this issue please? How do i work correctly with lights and materials in (mini)B3D?


simonh(Posted 2007) [#2]
If you can post the source code then I can try it in Blitz3D to compare.


North(Posted 2007) [#3]
Hi Simon,

sure thing and thanks for checking.




simonh(Posted 2007) [#4]
Yeah, it does the same in B3D. Use LightRange with a range value of 10 to get the desired effect.


North(Posted 2007) [#5]
Thanks Simon,

that works .. kind of.
If i wanted objects to be evenly lit whether they are 10 units away from the light source or 1000 units this would not work.
Think space simulation.. this light type might not be ideal but the only other that might be usable is the parallel light(1). which gives even illumination near and far but ... it is directional and thus not applicable for simulating a sun shining on its various sattelites.
Are there tricks to simulate such lighting conditions? The EntityColor-workaround might help but i'm not entirely happy with this solution unless a knowledgeable Blitzer can confirm this.

Thanks for your time!


Zethrax(Posted 2007) [#6]
Not sure if this has any relevance to the issue, but I'd suggest doing an UpdateNormals on the sphere after creating it (assuming minib3d supports that command).