volume rendering updates

September 24th, 2008 . 15 comments

Luckily, I’ve been able to work full time for a while on the volume rendering code, as part of budgeted R&D time at work. Since Monday I’ve made a lot of progress, and have been committing code to the ‘sim_physics‘ SVN branch, maintained by Daniel Genrich.

I’m actually quite surprised at how quickly I’ve managed to come this far, I guess I can attribute it partially to the clear design of pbrt, which I’ve used as reference for the fundamental structure. So far, I’m getting close to having it at a reasonably well integrated state with the rest of the renderer. Perhaps tomorrow it’ll be at a state where particles could be rendered by just instancing spheres at each point.


Some of the changes so far include:

  • Fixed the shading bug I mentioned earlier, due to a limitation in the raytrace engine (before, after). Now shading works quite nicely.
  • Added colour emission – as well as the overall ‘Emit:’ slider to control

    overall emission strength, there’s also a colour swatch for the volume to emit

    that colour. This can also be textured, using ‘Emit Col’ in the map to panel.

  • Cleaned up and clarified volume texture mapping, fixing the offsets and scaling, and adding ‘Local’ (similar to Orco) mapping, alongside Object and Global coordinates
  • Added colour absorption – rather than a single absorption value to control how much light is absorbed as it travels through a volume, there’s now an additional absorption colour. This is used to absorb different R/G/B components of light at different amounts. For example, if a white light shines on a volume which absorbs green and blue

    components, the volume will appear red. This colour can also be textured.

  • Refactored the previous volume texturing code to be more efficient
  • Worked on integrating volume materials into the rest of the renderer. Now other objects (and sky) correctly render if they’re partially inside or behind a volume. Previously all other objects were ignored, and volumes just rendered on black. The colour of surfaces inside or behind the volume gets correctly attenuated by the density of the volume in between – i.e. thicker volumes will block the light coming from behind.
  • Enabled rendering with the camera inside the volume.

Correct shading and absorption

Shading with two lamps

Shading within clouds density texture

Textured (with colour ramp) emission colour

Example of various absorption colours

Textured absorption colour

Objects and sky inside and behind volume

Shaded concave volume

Camera passing through a volume

§ 15 Responses to volume rendering updates"

  • wayne says:

    what!!?!?!?

    this is mad, thanks so much for all your dev work 🙂

  • broken_sword says:

    Is this for real-time??

  • Hi Matt,

    great work.

    I’m really curious about the render time. Since some of the effects looks like a solid SSS, it could be a cheap approach to simulate this kind of material.

    I was wondering if the render time is as high as the SSS.

    Best regards,

    Dalai

    @broken_sword – no, this is for rendering.

  • Really cool work you do! I must say that you’ve gone a long way (and past many) since I met you first at bconf 2004! You’re a guru now 😀

  • JiriH says:

    Excellent work Matt, good luck with it.

  • Matt says:

    Hey dudes, thanks for the kind words!

    broken_sword, no it’s not realtime at all 🙂

    Dalai, it’s similar in a way, but a much more generalised system – it covers all kinds of scattering in participating media. In that sense, for making things that SSS is designed for, such as skin, SSS is a lot more optimised for that task and is faster. This volume rendering stuff though, while more of a brute force method, is capable of many more effects that SSS isn’t suited for. You can get cool SSS-like effects though, here’s suzanne with the absorption cranked up to 3.0:

    http://mke3.net/blender/devel/rendering/volumetrics/vol_suzanne_ab3.png

    The render time on that was 17s on this dual althon 64.

    cheers!

  • blendificus says:

    as usual, your work and pace is impressive. Thank you for your contribution to the blender community across the globe

  • Shump says:

    Just a little confused with the absorption parameter. If something absorbs a certain colour, isn’t that supposed to not let out that colour. In example: something that absorbs white light would appear black. Something that is exposed to white light and absorbs red would appear purple. etc.

  • Sergeant Oreo says:

    Amazing.

    Thank you for all your work on this project Matt; it’s great to see Blender advancing to new levels of complexity and such thanks to coders like you. The pace it has gone at since the past year or so is alarming (in a good sense!) and I look forward to using the new features!

  • farsthary says:

    Hi Matt!

    I could today access internet and WOW! Im gladd to see you are progressing so fast!

    Congrats!

  • Matt says:

    Hi Shump, that is indeed correct, it’s just rather unintuitive and needlessly difficult to use 🙂 So what you set in the UI is actually the inverse of the absorption colour – its the colour that the volume will become when the other colours are absorbed.

  • inazuma says:

    Awesome work Matt!

    I compiled your latest commits this morning and have been playing around with the new turbulence features all day. Cool stuff – not so cool as it’s been distracting me from other work 🙂

    Keep up the great work!

  • Chris M. Wilson says:

    Awesome stuff. This is gonna be huge.

    Any chance some kind soul might put a build on graphicall.org?

  • Hey Matt, Where’s that update I wanted? 🙂 Saw the bunyip. Nice effect.

    Glenn

  • RH2 says:

    Nice work!

Leave a Reply to glenn melenhorst Cancel reply

Your email address will not be published. Required fields are marked *

What's this?

You are currently reading volume rendering updates at Matt Ebb.

meta