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 / Strange Lights 1

Author
Message
theagg
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location:
Posted: 24th Feb 2008 14:35
Can someone explain to me why this..........



Results in the plane being illuminated a bright yellow, evenly across its entire area.

Whereas this...



Results in the same plane being illuminated a much darker brown, evenly across its entire area.

The only change between the two chunks of code being the size of the plane.

Normally I would expect to see an illuminated \'hotspot\' closer to the light source and the light levels tapering off the further away the surface is from it. Ie thats how \'real\' lights work.

Not in this case though, so what do I have to do to achieve \'realistic\' illumination drop off in relation to distance from source.

I will leave the issue of how to get objects to cast shadows on the plane for the next post ??!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 24th Feb 2008 19:44
@theagg
What happens if you use dbSetObjectSmoothing(17,100) ?
If it then works, it's because without smoothing, light is only calculated for individual vertices. With a big plain, all four vertices are far from the light, so the whole plain becomes dark. When it is small, all the vertices are close to the light, so the whole plain becomes light. With smoothing, light is calculated for each pixel, and instead of the final colour being interpolated over the whole object, the normals are interpolated, and the final colour is calculated for each pixel individually.

theagg
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location:
Posted: 24th Feb 2008 20:50
Hmm, it changes the rendering subtly but not to the degree wanted. ( ie not that much difference but I see what it is you are referring to )

Perhaps then I need to use a terrain mesh instead of a plane, since the terrain mesh with have many more 'vertices' across its surface ?

I will have to work out how to set up a terrain mesh first though, the density of the mesh etc. But does a terrain mesh need a texture applied before it becomes visible.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Feb 2008 03:23
Only the GDK "Terrain" Does - It's Required I think.

As for loading a Mesh - that just happens to be a terrain in appearance, no - I think blank - no texture - is fine.

theagg
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location:
Posted: 25th Feb 2008 15:57
Hmm, so I will have to create a flat mesh in a third party program and load it in using the loadmesh command ?

Question is, then, how do I position that mesh, make it visible and colour it etc ?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Feb 2008 19:14
Well.. you have a few options... I think your issue is how the hardware light is effecting that one huge plain you're making.

If that is your main concern - and you want the single flat ground really big - (2 poly is very low - effieicent as far as rendering thats for sure) then maybe set light to off for your plain and use "set object emissive" or "set object ambiance" or something to get it to look close.

Loading a model - whether a terrain mesh or a car (to answer your last question) all can be moved, colors, textured etc like any other object.

The difference I was referring to earlier was the DarkGDK "TERRAIN" system - though it uses the object ID's as objects - needs to have a texture and needs to created via the terrain commands. Also - the normal object commands mostly work fine but you might find a caveat here and there trying to manipulate a GDK "TERRAIN".

When I say GDK "TERRAIN" I do not mean loading a model that just happens to be "ground" that you make into your own custom "terrain". I mean a GDK TERRAIN OBJECT - slightly different than regulat OBJECT's but share same OBJECT ID Numbers.

Login to post a reply

Server time is: 2024-11-20 03:42:24
Your offset time is: 2024-11-20 03:42:24