Jump to content

non-square shadow maps for distant light?


Recommended Posts

hi guys,

i have a 'distant light' illuminating a large landscape from a very low angle, and to optimize the scene i'd like to have a non-square shadow map, otherwise most of my map will not hit any geometry.

in the interface there doesn't seem to be a simple way to set this up.

i did manage to set it up by scaling my light in Y (e.g. to 0.5) and adding an 'aspect' float parameter just like you have on cameras and setting it to the same value. but shouldn't this be easier?

maybe the aspect parameter should be on the light by default, although invisible, and both this and y scale could be calculated based on the X and Y resolution.

Link to comment
Share on other sites

  • 2 weeks later...

tried this in H8 ages ago, just setting a non-square resolution... weird things that I dont understand happened like the shadow missing from half the terrain, in the wrong place, etc...

I wouldn't worry too much about having to render it square, all that black doesn't really affect file size much because of the Rat compression. It takes a bit longer to render all that empty space though, but not that much.

Link to comment
Share on other sites

Hey Aearon

Testing this with a spotlight, under depth map options

u can specify what ur resolution is, and in the case ur dealing with a longer flatter image, then just increase the X resolution, or decrease the Y res :)

that should work.

post-585-1220721335_thumb.png

hope this helps

Link to comment
Share on other sites

hi,

thanks aracid, it does work with a spotlight. and exactly the way i would have expected. i guess Serg is right about it not being a big deal, but maybe i can just use a faraway spotlight for now,

anyway this should be a bug report then, if it works with a spotlight, it should work just the same with a distant light.

with a distant light, whatever resolution you set, the map is stretched out to square when the final image is rendered. it looks like the map itself is rendered correctly though. this is why the shadows appear in the wrong places Serg.

i attached an example of it not working.

i tested in 9.5.209 and 9.5.219, windows xp, VC8 build

distlight_rect_shadowmap.hipnc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...