Tutorial - Rendering A Shadow Map

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

Re: Tutorial - Rendering A Shadow Map

Post by jlv »

The FBO/TexSubImage message determined by the "Terrain Rendering Method" graphics setting. You want to use FBO's if you can, which is the Hardware/Direct setting.

If the track was created in the editor and you haven't changed the lighting settings, the only thing that should change is the shadows should show up. Are you sure the file is really a PGM? Some export filters will create a PPM file with a PGM extension. Try converting to greyscale before you export it.
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: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

Maybe its not working because Ive not done this part?

// SCALE x (RESOLUTION - 1) = LENGTH & WIDTH ---> EG. 1.6 x (1025-1) = 1638.4

I have no clue what to do there. The rest all checks out though.
Image
jlv
Site Admin
Posts: 14910
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Rendering A Shadow Map

Post by jlv »

If you get that wrong, the shadows will be in the wrong places. Sounds like you're not getting any shadows at all. Does the shadow map's dimensions match your terrain's dimensions?
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: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

Yep, resize it to 1025x1025 which is the same size. Im kind of at a loss on this one. Ive redone it three times, the shadow picture looks right (i think) but just will no show up even after the reshade. Might just give up on this one and try on my next track.
Image
slowngreen
Posts: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

This pretty much looking the way it should prior to saving it as a pgm? If so, I open it in photoshop cs2, save as, shadow.pgm and select portable bit map which has pgm in parentheses.

Image
Image
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Tutorial - Rendering A Shadow Map

Post by DJ99X »

I usually lighten it a bit so you can still see rut shadows
slowngreen
Posts: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

^^^wish that were a problem lol.
Image
jlv
Site Admin
Posts: 14910
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Rendering A Shadow Map

Post by jlv »

The image should be 1025x1025, not 1024x1024. It also needs to be greyscale rather than RGB or the export filter is likely to save it as a PPM instead of a 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.
slowngreen
Posts: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

I am doing 1025x1025 for sure. Also just to double/triple check when I mouse over the shadow.pgm, it says "file type PGM".
Image
jlv
Site Admin
Posts: 14910
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Tutorial - Rendering A Shadow Map

Post by jlv »

Try opening it in a text editor and looking at the first few lines. For a 1025x1025 PGM file it should look like this:

P5
1025 1025
255

The garbled looking binary data after the header is normal.
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: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

darn, one more thing that checks out fine.

P5
1025
1025
255
Image
barrington314
Posts: 6614
Joined: Fri Feb 18, 2011 6:03 pm
Team: me
Location: Charleston, SC

Re: Tutorial - Rendering A Shadow Map

Post by barrington314 »

If you would like, upload what you have and PM it to me. Ill see if I can find the problem for you.
slowngreen
Posts: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

Yeah? thanks a ton man, I'll do it after a while.
Image
slowngreen
Posts: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

JLV, barrington pointed out my problem. I wish I could find someone to blame it on :lol: but my file was named shadow.pgm instead of shadows.pgm. I fixed that and they showed up. Huge thanks for all the help.
Image
slowngreen
Posts: 907
Joined: Mon Sep 02, 2013 6:18 pm
Team: MotoPin Racing
Location: idaho

Re: Tutorial - Rendering A Shadow Map

Post by slowngreen »

Having trouble again with this. Got my shadows rednered, resized, greyscaled and put back into my file but the I get this message at the top of the screen and the track wont load.
click pic to make it bigger if needed.
Image
Image
Post Reply