Sign in to follow this  
toasterthegamer

Lighting a view aligned billboard in HLSL.

Recommended Posts

Hi, I have a randomly generate tree that I've made and I have billboarded leaves randomly placed on the tree. The problem I'm having is that I always rotated them towards the camera so when I go to light the model the lighting rotates weirdly. when you move around the leaves. To fix this for directional lighting I used something like: float3 diffuse = dot(light, float3(0, 1, 0)); This kind of works but now when I've added point light support to my shader it doesn't look so good anymore. this is because the point light is under the leaves thus they don't get shaded. The light could be above the leaves though and so I need some sort of dynamic normal generator biased on the point lights position. I figure there is a better way to doing all this then what i'm doing now. Any help will be great! -Toaster

Share this post


Link to post
Share on other sites

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