Tutorial - Rendering A Shadow Map

bdownen323
Posts: 2947
Joined: Mon Nov 28, 2011 11:00 pm

Re: Tutorial - Rendering A Shadow Map

Postby bdownen323 » Thu Jan 02, 2014 6:53 pm

When I go to render out the shadows it saves the shadows file as shadows.png in my shadows folder. But when I open it up in ps and save it as a pgm image it says "error reading shadows" ingame. I have the shadows set to 2049x2049 just like the terrain. Any ideas?

bdownen323
Posts: 2947
Joined: Mon Nov 28, 2011 11:00 pm

Re: Tutorial - Rendering A Shadow Map

Postby bdownen323 » Thu Jan 02, 2014 6:54 pm

DP, what should I do when it gives me this error?
Image

jlv
Site Admin
Posts: 12315
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby jlv » Thu Jan 02, 2014 11:56 pm

When you save the pgm file, try converting to greyscale first. It might be saving a ppm file with a .pgm extension.

Not sure what the POV warning is about.
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.

bdownen323
Posts: 2947
Joined: Mon Nov 28, 2011 11:00 pm

Re: Tutorial - Rendering A Shadow Map

Postby bdownen323 » Thu Jan 02, 2014 11:59 pm

I figured out the saving issue. I didn't realize I had to save it as a portable bitmap and make a pgm extension. I was trying to do a regular bitmap image with pgm extension. I'm still trying to figure out the pov issue.

User avatar
wheels1758
Posts: 4121
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby wheels1758 » Fri Jan 24, 2014 4:09 pm

JLV,

Can you post your shadows.pov file (the one you use in conjunction with the shell script)?

jlv
Site Admin
Posts: 12315
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby jlv » Sat Jan 25, 2014 12:23 am

Here it is:

Code: Select all

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

background {rgb <0.95,0.95,0.9>}

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

#if (0)
light_source {
   < -0.5, 1.0, -1.0 > * 10000, color White * 1000
   parallel
   point_at <0, 0, 0>
}
#end

light_source { < LIGHTX, LIGHTY, LIGHTZ >, color White * 1000 }

#ifdef (DIM)
#declare WIDTH = DIM;
#declare LENGTH = DIM;
#else
#declare WIDTH = 1025;
#declare LENGTH = 1025;
#end
 
#ifndef (SCALE)
#declare SCALE = 0.625;
#end

camera { orthographic location <(WIDTH/2.0-0.5)*SCALE, 1000, (LENGTH/2-0.5)*SCALE>
         right <-WIDTH*SCALE, 0, 0> up <0, 0, -LENGTH*SCALE>
         look_at <(WIDTH/2.0-0.5)*SCALE, 0, (LENGTH/2-0.5)*SCALE> }

#declare rangle = seed(0);

#macro person()
cylinder {
   <0.0, 0.0, 0.0>, <0.0, 5.0, 0.0>, 0.75
}
#end

#macro hidden()
cylinder {
   <0.0, 0.0, 0.0>, <0.0, 5.0, 0.0>, 0.75
   no_shadow
}
#end

#macro _light()
   hidden()
#end

#macro _30sec_30()
   hidden()
#end

#macro _30sec_turn()
   hidden()
#end

#macro _30sec_5()
   hidden()
#end

#macro _30sec_run()
   hidden()
#end

#macro _30sec_done()
   hidden()
#end

#macro roost()
   hidden()
#end

#macro finish_green()
   person()
#end

#macro finish_crossed()
   person()
#end

#macro finish_white()
   person()
#end

#macro checkerwave()
   person()
#end

#macro flagger_resting()
   person()
#end

#macro flagger_waving()
   person()
#end

#macro guy01()
   person()
#end

#macro guy02()
   person()
#end

#macro guy03()
   person()
#end

#macro guy04()
   person()
#end

#macro guy05()
   person()
#end

#macro guy06()
   person()
#end

#macro girl01()
   person()
#end

#macro _triplight_green()
   hidden()
#end

#macro _phathry()
   person()
#end

#macro _sweendoggy()
   person()
#end


#include "trackstripped.pov"

object {
   statues
   texture {
      pigment { color rgb <0.0, 0.0, 1.0> }
      finish { diffuse 1.0 }
   }
   no_image
}
object {
   billboards
   texture {
      pigment { color rgb <0.0, 0.0, 1.0> }
      finish { diffuse 1.0 }
   }
   no_image
}
object {
   ground
   texture {
      pigment { color rgb <1.0, 1.0, 1.0> }
      finish { diffuse 1.0 }
   }
}
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.

User avatar
wheels1758
Posts: 4121
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby wheels1758 » Sat Jan 25, 2014 12:47 am

Thank you sir.

BETABERGGREN
Posts: 24
Joined: Fri Jan 10, 2014 7:04 pm
Team: Privateer

Re: Tutorial - Rendering A Shadow Map

Postby BETABERGGREN » Sat Feb 01, 2014 8:19 am

Can you make a movie on youtube on that?
Image

User avatar
wheels1758
Posts: 4121
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby wheels1758 » Tue Feb 04, 2014 12:07 am

BETABERGGREN wrote:Can you make a movie on youtube on that?


Who, on what?

User avatar
MX181
Posts: 800
Joined: Tue Dec 25, 2012 12:45 am
Location: STRAYA

Re: Tutorial - Rendering A Shadow Map

Postby MX181 » Tue Feb 04, 2014 1:17 am

wheels1758 wrote:
BETABERGGREN wrote:Can you make a movie on youtube on that?


Who, on what?

im gueesing he wants to know how to use the script

User avatar
wheels1758
Posts: 4121
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby wheels1758 » Tue Feb 04, 2014 3:54 pm

MX181 wrote:
wheels1758 wrote:
BETABERGGREN wrote:Can you make a movie on youtube on that?


Who, on what?

im gueesing he wants to know how to use the script


That's what I mean. If he is talking about the stuff in the first post by DJ, that's one thing.

If he doesn't know how to use the script(s) JLV posted, he's probably not running linux, so it is a bit of a moot point.

slowngreen
Posts: 904
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Postby slowngreen » Thu Feb 06, 2014 1:46 am

Dont think its been asked....soooo...

Ive done everything and put the resized shadow.pgm into my track folder but no shadows show up and it says this across the top of the screen,
Texture rendering with framebuffer objects
Image

jlv
Site Admin
Posts: 12315
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Rendering A Shadow Map

Postby jlv » Thu Feb 06, 2014 4:11 am

You have to reshade the track in the editor. Put it in raise mode, submode lower only and then paint over the whole 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.

slowngreen
Posts: 904
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Postby slowngreen » Thu Feb 06, 2014 4:19 am

Oh ok thanks JLV!
Image

slowngreen
Posts: 904
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Postby slowngreen » Thu Feb 06, 2014 5:32 pm

Didnt work? Shouldnt the map change/lighten in color if its refreshed right? I tried JLV's way and also tried smoothing the entire map and nothing has changed (yes I save it and restart). Only difference is now it says at the top "rendering with textsubimage".
Image


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest