Tutorial - Rendering A Shadow Map
Re: Tutorial - Rendering A Shadow Map
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.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
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.
"Texture rendering with framebuffer objects"
When I had that problem before it was after the track was loaded but it wont load now.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
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
You need to set the width and height variables to match the scale of your track.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
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;
#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
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?
Is it way off or only off by a few feet?
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
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](http://i183.photobucket.com/albums/x193/slowngreen/Untitled-14.png)
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](http://i183.photobucket.com/albums/x193/slowngreen/Untitled-14.png)
Re: Tutorial - Rendering A Shadow Map
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?
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
Forgot, this is whats in the Terrain.hf file...
10 1.000000 11.276687 158.827667
10 1.000000 11.276687 158.827667
Re: Tutorial - Rendering A Shadow Map
Looks like your scale is set to 1, not 1.6. So your length and width should be 2048.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
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
The scale is the second number in terrain.hf:
It means each pixel in the terrain is 1 foot away from its neighbor.slowngreen wrote:Forgot, this is whats in the Terrain.hf file...
10 1.000000 11.276687 158.827667
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 907
- Joined: Mon Sep 02, 2013 6:18 pm
- Team: MotoPin Racing
- Location: idaho
Re: Tutorial - Rendering A Shadow Map
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.