Page 9 of 13

Re: Tutorial - Rendering A Shadow Map

Posted: Fri Feb 07, 2014 12:20 am
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Feb 09, 2014 2:27 am
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Feb 09, 2014 3:10 am
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?

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Feb 09, 2014 3:39 am
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Feb 09, 2014 3:50 am
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

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Feb 09, 2014 4:17 am
by DJ99X
I usually lighten it a bit so you can still see rut shadows

Re: Tutorial - Rendering A Shadow Map

Posted: Sun Feb 09, 2014 7:49 pm
by slowngreen
^^^wish that were a problem lol.

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Feb 11, 2014 2:47 am
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Tue Feb 11, 2014 3:25 am
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".

Re: Tutorial - Rendering A Shadow Map

Posted: Wed Feb 12, 2014 3:05 am
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Wed Feb 12, 2014 6:06 pm
by slowngreen
darn, one more thing that checks out fine.

P5
1025
1025
255

Re: Tutorial - Rendering A Shadow Map

Posted: Wed Feb 12, 2014 6:12 pm
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Wed Feb 12, 2014 6:16 pm
by slowngreen
Yeah? thanks a ton man, I'll do it after a while.

Re: Tutorial - Rendering A Shadow Map

Posted: Thu Feb 13, 2014 12:26 am
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.

Re: Tutorial - Rendering A Shadow Map

Posted: Sat Mar 29, 2014 9:39 pm
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