Hi guys,
Here’s a screenshot of a sketch I am currently working on.
On the upper left corner is a minimap of the dungeon (only tiles that have been seen are shown). The little green arrow there represents the player (technically, the camera).
In the middle of the screen there is a black spot: Processing seems to stop rendering anything more distant than (in my calculations) about 20000 pixels away from the screen.
(The calculation is as follows: each tile in the dungeon is 256×256 pixels; the minimap’s tile size is 4×4 pixels, and the ray seems to partly touch that distant wall which is seen through the open door) (I hope I make myself clear enough, just make sure to take a thorough look at the picture)
So here is my 1st question: can anyone tell the exact distance that Processing considers too far to render?
And the 2nd questions (the main one) is this: how can I make up lights so that anything so far (or maybe a little less than that) would dissolve into darkness?
I tried to arrange a pointLight() in the same place where the camera() is but it doesn’t seem to make it the way I’d like.
The perspective() solved the distanse clipping problem.
Any ideas about as how to add lights to it? I want it to be lit near the camera and the farther the darker. pointLight() doesn’t seem to do it (or I fail to arrange it in a proper way)
Thank you, guys! Chrisirquark
I tried to play with the lightFalloff() but didn’t get the numbers right to do the task.
Actually I think the problem might be in the way I display my dungeon. Follow this: the lights colorify everything according to the normals to the surfaces. My guess is I somehow arrange my surfaces that their normals look outside the light, so they are always in the shadow… but without lights() they are shown in their natural color
I guess I’ll have to rewrite my visualization routine for the dungeon. the tutorials say I must declare vertices inside beginShape()…endShape() in a proper way so that when the normals are calculated they look in the proper direction (outside off the walls towards the empty space).