Sign in to follow this  

Enlarging an object post-procss

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

Hi, I'd like to an alraedy rendered object and make it large as a post-process step. Not just a simple scale, like if it was a donut, i'd want the hole to shrink as well. Anyone know where I should start with this?

Share this post


Link to post
Share on other sites
Please explain 'post-process'. Are you talking about after you model the object, after you transform the object, or after you render the object? I'm not sure I understand how it would be possible to scale an object after it has been rendered.

Share this post


Link to post
Share on other sites
This would imply each vertex moving away from the "body" of the model, so translating vertices by their normal vector would be a good start.

Share this post


Link to post
Share on other sites
I think he means after it is rendered. You would have to store some extra information in an offscreen buffer in a semi-deferred shading setup. Most likely you could store the vertex normal interpolated per-pixel, then projected onto the screen space by setting z=0 after you are in clipspace.

Then when you want to expand the object, you either need to have some way of detecting this particular object. If it is the only object that will scale, all of the other normals will be zero in your normal buffer, so you could just render a full screen post process quad that samples the back buffer by offsetting its texture coordinates by the normal vector.

Thats not a perfect algorithm, but it should get you started.

Share this post


Link to post
Share on other sites
Sign in to follow this