Tutorial - Rendering A Shadow Map
Re: Tutorial - Rendering A Shadow Map
Blur in PS is your friend....
Appreciate my hard work? Buy me a beer,
https://www.paypal.me/Motoboss
Check out my Facebook Page
My YouTube Channel - https://www.youtube.com/channel/UCR5gAn ... z59ykqiKyA
https://www.paypal.me/Motoboss
Check out my Facebook Page
My YouTube Channel - https://www.youtube.com/channel/UCR5gAn ... z59ykqiKyA
-
- Posts: 1205
- Joined: Tue Oct 11, 2011 1:26 pm
- Team: Impact
- Location: France
Re: Tutorial - Rendering A Shadow Map
Hi, I'm doing well as it should, but when I get to step 6, I click on the run button but its brand me this:
I do how?
thank you;)
I do how?
thank you;)
Re: Tutorial - Rendering A Shadow Map
I normally just delete the startgate shadows. You can just delete the super thin objects from track.pov if it says they're missing a texture because it probably won't render shadows for them anyways.
-
- Posts: 6614
- Joined: Fri Feb 18, 2011 6:03 pm
- Team: me
- Location: Charleston, SC
Re: Tutorial - Rendering A Shadow Map
I noticed that some people turn the pgm into a png and place it in as one big decal. Is there a benefit to that, maybe with load times or frame rate? Im sure it wouldnt be much but some tracks are coming to the point that any extra resource help is nice to use.
Re: Tutorial - Rendering A Shadow Map
idk might make it easier to line up shadows i'm having trouble with the PGM's on lining up shadows
Attempted Photographer < I try.... Shitty racer, Only good at screenshots, forever pretending to be quick at MXS.
Re: Tutorial - Rendering A Shadow Map
It won't be lit correctly that way. It'll just be darker instead of being lit by ambient only. It won't be any faster.
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: 6614
- Joined: Fri Feb 18, 2011 6:03 pm
- Team: me
- Location: Charleston, SC
Re: Tutorial - Rendering A Shadow Map
Is there a trick to doing shadows for supercross, since it needs to be cast from multiple angles? Render it 6 - 8 separate times?
Re: Tutorial - Rendering A Shadow Map
Yes, it's six renders blended together. I use this shell script to automate it.
Code: Select all
#!/bin/bash
sed 's/image_map[^}]*}/Black/g' <track.pov >trackstripped.pov
scale=$(awk '{print $2}' <terrain.hf)
n=0
grep flare_point <lighting | sed 's/[][]//g' |
while read flare_point x y z rest
do
nice -19 /opt/povray/bin/povray -D -w2050 -h2050 \
Declare=SCALE=$scale \
Declare=LIGHTX=$x \
Declare=LIGHTY=$y \
Declare=LIGHTZ=$z shadows.pov || break
mv shadows.png shadow$n.png
n=$((n+1)) # this is in a subshell and doesn't update the outer scope
done
n=$(ls shadow[0-9].png | wc -l)
scale=$(bc <<<"scale=5;1/$n")
pngtopnm <shadow0.png | pamfunc -multiplier $scale >s.ppm
for ((i=1;i<n;i++))
do
echo combine $i
pngtopnm <shadow$i.png | pamfunc -multiplier $scale >t.ppm
pamarith -add s.ppm t.ppm >u.ppm
mv u.ppm s.ppm
done
ppmtopgm s.ppm | pamscale -xysize 1025 1025 >shadows.pgm
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: 195
- Joined: Tue Jul 24, 2012 11:27 pm
- Team: TwistMoto Racing
- Location: Arizona
- Contact:
Re: Tutorial - Rendering A Shadow Map
I was working on a SX night track recently (I had ten lights... ) and could not for the life of me remember how to correctly code a batch file to accomplish this, and an hour in Linux reminded me of everything I have forgot about it so I made some adjustments to the shadows.pov.jlv wrote:Yes, it's six renders blended together. I use this shell script to automate it.
Code: Select all
#!/bin/bash sed 's/image_map[^}]*}/Black/g' <track.pov >trackstripped.pov scale=$(awk '{print $2}' <terrain.hf) n=0 grep flare_point <lighting | sed 's/[][]//g' | while read flare_point x y z rest do nice -19 /opt/povray/bin/povray -D -w2050 -h2050 \ Declare=SCALE=$scale \ Declare=LIGHTX=$x \ Declare=LIGHTY=$y \ Declare=LIGHTZ=$z shadows.pov || break mv shadows.png shadow$n.png n=$((n+1)) # this is in a subshell and doesn't update the outer scope done n=$(ls shadow[0-9].png | wc -l) scale=$(bc <<<"scale=5;1/$n") pngtopnm <shadow0.png | pamfunc -multiplier $scale >s.ppm for ((i=1;i<n;i++)) do echo combine $i pngtopnm <shadow$i.png | pamfunc -multiplier $scale >t.ppm pamarith -add s.ppm t.ppm >u.ppm mv u.ppm s.ppm done ppmtopgm s.ppm | pamscale -xysize 1025 1025 >shadows.pgm
I set it up to use spotlights and render all of the lights at once. Maybe this will help somebody out when they are trying to setup their shadow map. If you get stuck there are instructions in the file, and you will need to follow DJs basic instructions.
http://www.mediafire.com/download/gvrpb ... shadows.7z
-
- Posts: 195
- Joined: Tue Jul 24, 2012 11:27 pm
- Team: TwistMoto Racing
- Location: Arizona
- Contact:
Re: Tutorial - Rendering A Shadow Map
You have to remove the startgate.ppm lines from your track pov file, before you run the shadows.pov. Also make sure there are no billboard lines in your tracks pov cause that will be the next error.
-
- Posts: 6614
- Joined: Fri Feb 18, 2011 6:03 pm
- Team: me
- Location: Charleston, SC
Re: Tutorial - Rendering A Shadow Map
Or just make a ppm image in photoshop thats a solid color and save it as startgate.ppm and put that in the render folder.twistmoto wrote:You have to remove the startgate.ppm lines from your track pov file, before you run the shadows.pov. Also make sure there are no billboard lines in your tracks pov cause that will be the next error.
-
- Posts: 619
- Joined: Sun Jan 08, 2012 10:12 am
- Team: Chicken Wings & Beer
- Location: ON, Canada
- Contact:
Re: Tutorial - Rendering A Shadow Map
okay ill try that thanks
Re: Tutorial - Rendering A Shadow Map
sed 's/image_map[^}]*}/Black/g' <track.pov >trackstripped.pov
Unix makes life easier!
If you're on Windows you want to replace all image_map sections with "Black". So if you have this:
texture { uv_mapping pigment { image_map { png "sx2013/scorehousemotooption.png"} } scale <1,-1,1> }
You want to edit it to this:
texture { uv_mapping pigment { Black } scale <1,-1,1> }
Unix makes life easier!
If you're on Windows you want to replace all image_map sections with "Black". So if you have this:
texture { uv_mapping pigment { image_map { png "sx2013/scorehousemotooption.png"} } scale <1,-1,1> }
You want to edit it to this:
texture { uv_mapping pigment { Black } scale <1,-1,1> }
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: 619
- Joined: Sun Jan 08, 2012 10:12 am
- Team: Chicken Wings & Beer
- Location: ON, Canada
- Contact:
Re: Tutorial - Rendering A Shadow Map
thanks ill try this stuff when im less frustrated with new programs haha