Tuesday, February 19, 2008

Caustics in Brazil r/s Tutorial Appendix

In this short Appendix to "Tutorial: Rendering Caustics in Brazil r/s" I will make a simple demonstration of how caustics are generated by different basic geometries. I hope that some of you will find it useful and also it will save you some time on your own projects. Scene settings are the same as in my caustics tutorial with the teapot. I also attempted to use different sizes and positions for the objects to show variations.

Standard Primitives


Extended Primitives




contributed by Pavel Romsy

Monday, February 11, 2008

Tutorial: Making of Lamborghini Gallerdo

Here's a nice Brazil 1 tutorial by Simon Nutall (Iconized). It covers the whole look-dev process and includes the construction of the model, some good observations, and texturing and setting up the materials.


It's nearly a two years old, but something bumped it's rss feed so google alerts just picked it up yesterday.

Tuesday, February 5, 2008

A few speed tips and tricks: Glossy materials, Lot of lights

I usually do interior renderings. This means that I use a lot all the cpu-killing bells and whistles available: glossy materials, area shadows, ies lights, GI etc. I have to render at 4k size or even more, so, in order to keep rendertimes as low as possible, I've learned to use a few tips.

  • Glossy materials

    Almost every material, in real life, is both reflective and bumpy. Obviously some material's reflections and/or bumpyness are so slightly noticeable that you can reproduce their aspect with a lot of workarounds and tricks. B2 material's glossiness itself is a trick - a trick to visually render the material roughness without having to use a bump or displacement map.

    In my scenes I use a lot of glossy materials, almost 80% of the scene objects. So optimization for me is a must.
    B2 glossy reflection default values could be too high in a lot of situations. I usually tweak the adaptive sampling Max Error, 'till I reach a good quality/speed compromise.
    Default is 0.01, if possible I rise it to 0.05 - 0.2 , depending on the scene.

  • Lot of lights

    Ever had a scene with lot of lights, maybe with area shadows? A scene setup like this can easily kill your machine - and your rendertimes. Luckily, there's room for speed improvements, without sacrificing quality.
    1. Attenuation
      Turn on "attenuation" in your B2 light's feature panel. Then scroll down to the attenuation panel. I usually keep the defaults ("cubic spline", "Far" attenuation only), then I tweak the "Far" ranges - usually I raise the "start" radius until the attenuation "sphere" intersects the floor, and a little bit more for the "end" radius.


      Original scene by Robert Boothman. 39 B2 Ies Ligths with Area Shadows.

      Then I do a sample rendering, to check if the rendering aspect is similar to the one without lights attenuation. Here's the result:


    2. Area Shadow Samples

      I used B2 ray shadows set to disc area, and left all the default settings except for Disc Area Diameter. The area shadows min/max samples are, by default, 8/64. I've used very low settings instead, 4/8. In order to make a comparison between higher and lower area shadows samples, I added some cylinders on the walls, used B2 render pass to temporarily substitute the scene materials with a grey plastic, and raised the AA settings to 0/2. Here are the comparison images (I did also a closeup near the cyilinders):




That's all - I hope they'll be as useful for you as they've been for me.

Thursday, January 17, 2008

The new Black

This blog's not dead yet... just been busy with other things. But, check this out: http://www.news.com.au/story/0,23599,23060778-13762,00.html

It's interesting because when we get into creating realistic materials we oftentimes say things like "don't use 100% white or 100% reflective materials because they react unrealistically in the environment." Here's the same idea on the total blackness side of things: "Basic black paint, by comparison, has a reflective index of 5 per cent to 10 per cent." So even though your brain might be saying, "I want black," don't automatically crush the RGB vals down to [0,0,0] :)

Tuesday, November 20, 2007

Showing-off with the new B2 Domelight

As some of you may already know, we've just released a new Brazil 2 pro build with several new beta features (check the attachments at the bottom of that post). We've already started getting some interesting test imagery -- I thought it would be cool to share :)


"Render test by Cuneyt Ozdas -- Domelight with Brazil 2 Advanced material, SSS texture and area highlights. The scene is lit by the "Walk of Fame" HDRI from http://www.hdrlabs.com/gallery/panoga... The same HDRI is used as an environmental reflection and can be seen in the chrome sphere. Rendertime: ~4 min/frame on a 2Ghz Core2 Duo notebook (T7200 processor) 2GB RAM Max9. Pure QMC solution, no irradiance/render-cache, and no additional lights in the scene."

The youtube video got pretty compressed, so here is a 800x600 divx 6 version. (1.5 MB)

... And an image by Nathan Fariss:

This one uses HDRI from the Domelight with GI, the new analytic bump mapping, the new bi-directional sub-surface scattering (sweet!), caustics, dispersion.... Nathan is threatening to add more features to it -- if he does, I'll update the image :)

Also -- google alerts sent me a link to a new Brazil V1 video tutorial today, called, "Easy Occlusion with Brazil R/S." A couple things to note on this: 1) You can do the same thing with colored lighting if you use the Chroma Shadow pass, and 2) his technique will not work if you're using over-bright/hdr lighting (the blacks in the shadows end up being clamped-1.0-intensity-light when inverted). For doing the lighting passes when you want to use over-bright/hdr lighting, use the white plaster pass.

Sunday, November 18, 2007

Anisotropic Highlights

Theory

Anisotropic reflections occur when small groves in a surface cause the reflection to be stretched in a particular direction. So how do we create them in 3d? Well first, anisotropic reflections in cg can be split up into two categories.

  • An Anisotropic Highlight. A highlight is just a faked reflection of a point light source. Most 3d apps have a way to do anisotropic highlights, and that's what this tutorial is about.
  • An Anisotropic Reflection takes an actual reflection of your scene or an environment map and stretches it based on an anisotropy direction. This will be discussed at a later date.
Take this real world example of a christmas ornament that's made up of fine synthetic hairs that all travel in one direction.

Figure 1
Figure 1

Here's the direction of the grooves.

Figure 2
Figure 2

Here's another anisotropic highlight on a sphere...

Figure 3
Figure 3

This is caused by grooves like this...

Figure 4
Figure 4

Here's some Anisotropic highlights on a plane. A horizontal highlight like this...

Figure 5
Figure 5

is caused by vertical grooves...

Figure 6
Figure 6

A vertical highlight like this...

Figure 7
Figure 7

is caused by horizontal grooves...

Figure 8
Figure 8

Here's the example of a CD or the bottom of a pot...

Figure 9
Figure 9

Here's the direction of the grooves that causes the pot picture above.

Figure 10
Figure 10

As you can see, the grooves always go in the perpendicular direction to where the highlight is stretched.

3dsmax's Brazil Advanced Material Rendered in Brazil 1.0 or 2.0

Brazil has an anisotropic highlight as part of the Brazil Advanced's Blinn Highlight Shader. It's similar to the standard max anisotropic highlight, but with a few differences.

Here's the anisotropic highlight with default settings...



Notice it's quite similar to Figure 3 above.

The orientation is defined in object space, so it defaults to the grooves traveling along the x axis of the object, which of course produces a highlight that goes straight up and down (again, the direction of the highlight is always perpendicular to the direction of the grooves). Changing the angle parameter from 0 to 90 will change the direction of your non-existent bumps, and hence change the look of the highlight to something similar to Figure 1.



Here's the interface to the shader


To achieve the pot example above, you need to provide the shader with a more complex direction. That's where the angle map slot comes in handy, which bases the angle of the anisotropy off of a black and white map.

In the angle map slot, place a gradient ramp and set it up like this...


So have the gradient go from black to white. Set it to Spiral. Also, note that the Output Amount is set to 360. This is because, in Brazil the Angle is from 0 degrees to 360, so you need to set the gradient ramp to go from a value of 0 to 360, which is achieved by multiplying the black to white gradient by a value of 360. So the color black remains 0, and the color white, which is usually 1, is now 360.

Make a cylidner, and apply a UVWMapping modifier on your object, and set it to planar from the top.

And we get the correct highlight...



To learn more about Anisotropic highlights and reflections, please visit http://www.neilblevins.com.

Wednesday, October 10, 2007

Tutorial: Rendering Caustics in Brazil r/s

Let's start by answering the question, "what are caustics?" According to wikipedia, "a caustic is [an] envelope of light rays reflected or refracted by a curved surface or object, or the projection of that envelope of rays on another surface." This results in the concentration of light into patterns of light and shadow that's projected onto another surface. Caustics are very common in the environment around us and can be used for both artistic effect and to increase the level of realism in 3d renderings.

photos: Jimmy Earl, Heiner Otterstedt

Brazil r/s will automatically and accurately render caustic generated by both reflective (mirror) and refractive (glass, water, etc.) sufaces.

This exercise will cover the various settings that enable and control rendering of caustics in Brazil r/s.

Breakdown

Start by downloading and rendering the example scene (3ds Max 8, and Brazil r/s 2.0).

The scene contains a ground plane, one direct light, a camera, a cylinder (to add some reflections) and a glass teapot that we will use as a caustic generator.

The scene's material setup is as follows:

  1. teapot = Brazil2 glass material with default settings.
  2. ground plane = Brazil2 advanced material with diffuse set to white and a small specular highlight.
  3. cylinder = Brazil2 advanced material with diffuse set to white, highlight shader set to "none" and fully self illuminated (luminosity: 255/255/255) with Kl set to 2.0 (this setting makes the reflected cylinder more visible).

The scene is illuminated by a direct spotlight and a small amount of direct sky light (color: 23/36/50). Most of our caustics will be generated from the spotlight.

The quality and shape of your caustics depends largely on the geometry used to generate the caustics. More complex geometry creates more complex caustics, reflecting and refracting your light rays in a greater variety of directions.

The rendered scene is shown below with notes what we want to do. The rotated camera view is there to make the image a little more dramatic and to get the caustics aligned into a diagonal.

Note: Make sure that Genrate Caustics is checked on in Brazil2 Glass material options.

Execution

  1. Enable Caustics
    1. turn on photons in light rollout -- keep the default settings.
    2. Switch the lights shadow generator to "Brazil2 Ray shadows" to make the shadow transparent as they travel through the glass object.

    3. Check "Enable" in "Brazil Photon Map Settings" rollout, and turn Caustics on (marked with red dot).

    4. Render.
      Caustics are there and look good already, but the transparent shadows look wrong.
  2. Fixup the shadows by changing the shadow mode to "Rectangular Area":
    1. In the spotlight's Brazil 2 Ray Shadows rollout, change the shadow mode to the "Rectangle Area"
    2. Give the shadow some size by setting the scale of the shadow's Area Light Scale to 10 by 10
    3. Adjusting the max error to 5% will give us a nice balance between performance and quality in this scene.

  3. Tweak the caustics settings
    1. Set the "Photons in Estimate" to 50
    2. Set the "Max Search Radius" to 1000
    3. Adjust the "Energy Tweaks" "Multiplier" to .55

      The larger Max Search Radius will blends sparse areas of the caustic photons together better, and the smaller number of Photons in Estimate will cause the photon gather to stop searching for more photons around the sampling points much sooner ("Smaller Effective Radius"). By lowering the energy Multiplier, we are preventing the amount of over-bright photons in the of caustics.
  4. Increase the image sampling and render
    1. Set the Image Sampling to 1 by 2.
    2. Render

Conclusion

Now we have our glass teapot with believable shadows and caustics. You can download and render this final scene here.

Caustics in Brazil r/s render very quickly, so they are a feature that's actually quite fun to play and experiment with. Try different settings from those above and note how the changes affect the rendering. In addition to that, try getting creative and experimenting with some of the following:

  1. Glossy reflections on the teapot glass material.
  2. Allow Absorption in the glass material.
  3. Try caustics with Dispersion.
  4. Play with area shadow settings.
  5. Experiment with the "Affect Surface" settings in the light.
  6. Try different Photon Map Settings.
  7. And in the end, why not a little of post-production?

The techniques mentioned above were all used in the creation of the following picture:

Tutorial Contributed by Pavel Romsy