Sign in to follow this  

CubeMap vetex Projection

This topic is 3588 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

You'll have to be a bit more precise. What exactly do you mean by projecting a vertex colour ? Colours can't be projected, only vectors can. Do you mean a vector that is encoded as a vertex colour ? If so, then yes, this is indeed possible.

Share this post


Link to post
Share on other sites
Ah OK, I see.

This could be done like this: first, you would render your geometry directly to a cubemap render target. Have a very small shader pair that would simply output the interpolated vertex colour. You didn't specify what kind of parametrization, ie. what kind of mapping between the vertex and the resulting position in the cubemap you want, so you have to adjust this render pass accordingly.

I assume this is for some kind of dynamic lighting or reflection set up. In this case, just render the geometry to the cubemap as six passes, using a 90° FOV camera oriented accordingly. That's it.

The result is a cubemap that contains the (interpolated) vertex colours of your geometry. You can now use that cubemap in subsequent passes, and index it with whatever you need (normal, reflection vector, etc).

Share this post


Link to post
Share on other sites
That's right,

Almost everything is done, my problem is what transformations do i need to do to the vertex in the 1st pass so that in the second pass i can retrieve only using the normal's? Just like in cubemap diffuse light, but in this case the diffuse map must be generated dynamically. My problem are the vertex transformations on the 1st pass.

Using Normal, View and Projection with 90º when retrieving with normal as cube coordinates the vertex color doesn't match on the same geometry. How can i do this?

Thank you

[Edited by - jbastos on February 16, 2008 3:13:35 PM]

Share this post


Link to post
Share on other sites

This topic is 3588 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