Jump to content
  • Advertisement
Sign in to follow this  
jbastos

CubeMap vetex Projection

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

Hello, Is it possible to project a vertex color to a cubemap along the normal using directx9 and hlsl? And then retrieving it on a second pass.

Share this post


Link to post
Share on other sites
Advertisement
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
No sorry,

I want to save the color on a vertex to a cube map on a 1st pass and then retrieve it on a second pass using the vertex normal.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!