Sign in to follow this  

Should I use a shader in this case or not?

This topic is 1444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a 2D scene of polygons rendered with D3D11 and I have a light source on the screen.I need to compute a shadow map find out how much of the floor is lit(unoccluded by the polygons).The thing is I'm not sure how to do it in 2d, should I just give the polygons a height and then render a cubemap from the light's points of view?And then download shadow map to staging texture and loop trough dark pixels?Can anyone suggest a technique?

Share this post


Link to post
Share on other sites

It is not possible to automatically create shadows from 2D data. You need 3D objects for that.

 

However, if you have a map from "above", the light source is a lamp sitting on the floor, and all objects on the map should create shadows on the floor, then it is kind of possible. I suppose you can use a 1D shadow map for that? It would record the distance to all objects from the light source. As the world is 2D, only a 1D shadow map would be needed. Funny thing, I never tried that.

Share this post


Link to post
Share on other sites

This topic is 1444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this