Jump to content
  • Advertisement
Sign in to follow this  

Rendering a Glob of Jelly

This topic is 4260 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 all ... I was wondering if you guys could help me understand how one would go about rendering a translucent glob of jelly. The effect I have in my head could possibly be described as distorted alpha blending. So, other items viewed through will be blurred and distorted. Also, I'm guessing that there will be some sub-surface light scattering involved because I would like the jelly to light up if a light source is brought near it. I'm not asking for you guys to implement it for me as I know its somewhat of a tall order ... just some guidelines, and perhaps some keywords I could use to look up further information on the techniques required to achieve this effect. I'm pretty much a noob when it comes to graphics programming, but hey, gotta start somewhere :-) I have some fairly basic rendering going on and I want to get a better understanding about how shaders play a part in creating effects such as the one I described above. If it helps, I'm using C#, XNA, and HLSL :-) Thanks!

Share this post


Link to post
Share on other sites
Advertisement
The distortion is called "refraction"... It's often used in water rendering so you should be able to find good examples. It involves rendering the background into a texture which is then warped in the shader, in this case perhaps depending on the surface normal (of the blob). Blurring the texture is a common shader effect too ("bloom" effect is based on blurring). Again, a web search will get you lots of examples.

Share this post


Link to post
Share on other sites
So if I understand you correctly, these are roughly the steps I would have to take to render this ...

1. Render my object with alpha blended textures.
2. Pass it off to a shader that will:
-change the vertex coordinates based on the surface normal
-blur the textures in a second/third pass
-bloom the bright spots with a few more passes in the shader

is that about right? Would I need to pass any further information to the shader other than the texture?

Thanks for your help so far :-)

Share this post


Link to post
Share on other sites
It could work like this:

1. Render what's behind the blob into a texture
2. Blur the texture (possibly by rendering into yet another texture)
3. Render the blob with a refracting shader using that texture (plus whatever else the blob needs, like reflections and lighting). This may be single pass or multiple passes depending on how many texture units you have.

Bloom is a separate thing, I only mentioned it because you can find out how to do the blurring by looking at bloom tutorials; Bloom is "render the whole scene into a texture, blur it, and blend it over the scene" so parts of the code will be useful to you.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!