Page 10 of 13

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Mar 30, 2014 3:07 am
by jlv
What does your lighting file look like? The error means you probably have a space instead of an underscore in the "dynamic_lighting 1" line.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Mar 30, 2014 4:09 pm
by slowngreen
Ah ok that fixed that part. The 2nd line is still showing up though and it wont open the track.

"Texture rendering with framebuffer objects"

When I had that problem before it was after the track was loaded but it wont load now.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Mar 30, 2014 6:03 pm
by slowngreen
Nevermind I fixed it, I was resizing to 1025 when its a 2049.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Mar 30, 2014 6:29 pm
by slowngreen
Hmmmm, one last problem. I cant get the shadows to line up at all? They are way off. Any ideas?

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Mar 30, 2014 11:18 pm
by jlv
You need to set the width and height variables to match the scale of your track.

Re: Tutorial - Rendering A Shadow Map

Posted: Mon Mar 31, 2014 1:46 am
by slowngreen
Isnt that the 2049x2049? I did the math and put it in the right place, I thought?

#declare LENGTH =3278.4; // SCALE x (RESOLUTION - 1) = LENGTH & WIDTH ---> EG. 1.6 x (2050-1) = 3278.4
#declare WIDTH = 3278.4;

Re: Tutorial - Rendering A Shadow Map

Posted: Mon Mar 31, 2014 3:25 am
by jlv
If your resolution is 2049 and scale is 1.6 it should be 1.6*(2049-1)=3276.8.

Is it way off or only off by a few feet?

Re: Tutorial - Rendering A Shadow Map

Posted: Mon Mar 31, 2014 4:04 pm
by slowngreen
Its way off.

Heres the top several lines of stuff Im using, see any problems? Im using [4098, AA 0.3] too btw.

#include "colors.inc"
#include "rand.inc"

background {rgb <0.95,0.95,0.9>}

global_settings { ambient_light rgb <0.25, 0.25, 0.25> }

light_source {
< 1.0, 1.414, 1.0 > * 10000, color White * 1000 // PUT SUN CO-ORDINATE IN THE ARROW BRACKETS
parallel
point_at < 1.0 1.0 1.0>

}


#declare LENGTH =3276.8; // SCALE x (RESOLUTION - 1) = LENGTH & WIDTH ---> EG. 1.6 x (2050-1) = 3276.8
#declare WIDTH = 3276.8;

camera { orthographic location <WIDTH/2-1, 1000, LENGTH/2-1>
right <-WIDTH, 0, 0> up <0, 0, -LENGTH>
look_at <WIDTH/2-1, 0, LENGTH/2-1> }

#declare rangle = seed(0);



Then heres the screen shot of the shadows in place.

Image

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Apr 01, 2014 12:57 am
by jlv
Looks like it's way off. What's in your terrain.hf file? When you move the cursor to the bottom right of the terrain in the editor, what coordinates does it show?

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Apr 01, 2014 1:23 am
by slowngreen
2044.96-2044.96

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Apr 01, 2014 1:30 am
by slowngreen
Forgot, this is whats in the Terrain.hf file...

10 1.000000 11.276687 158.827667

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Apr 01, 2014 3:18 am
by jlv
Looks like your scale is set to 1, not 1.6. So your length and width should be 2048.

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Apr 01, 2014 5:05 pm
by slowngreen
Yes that worked! Huge thanks JLV, I could not figure out what was going on. To help me understand, what made it 1:1 scale? The amount of area I used of the map?

Re: Tutorial - Rendering A Shadow Map

Posted: Wed Apr 02, 2014 12:42 am
by jlv
The scale is the second number in terrain.hf:
slowngreen wrote:Forgot, this is whats in the Terrain.hf file...

10 1.000000 11.276687 158.827667
It means each pixel in the terrain is 1 foot away from its neighbor.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Jun 01, 2014 2:37 am
by slowngreen
Got a question again....Im putting shadows in a new track Im doing but every time it finishes the shadow render you can barely and I mean barely see any shadows on the white back ground and I think they are just the bales showing up. Im using the same trees as always, they just arent showing shadows.