Posts Tagged ‘Tips and Tricks’

Taking a rendering for a spin.

Monday, January 28th, 2008

Yay! A post for 2008! Happy New Year (and a few days… or more). 
Sometimes Often times I struggle to come up with neat tricks for this blog. Then I stumble on something and someone points out that it would be good blog fodder. Here’s one case and point..Anyone who knows me, knows that my current design tool fascination is real-time rendering. I just think it’s the most time saving thing for us product designers. It just eliminates so many steps of the ‘process’ and accelerates us toward our visions faster than ever.   

Alias Studio (my design tool of choice) has some pretty nice real-time visualization features, but since the features are fairly new to the tool, there are always additional features I wish for whilst using them. One such is to have a bit more control over the Image Based Lighting (IBL) set-up. There are some nice tone-mapping features, but no features that control the placement of the IBL image itself.

In this example, I have a product design from my archive that has had shaders assigned, ambient occlusion calculated and an image loaded into the IBL slot of my environment. The image is from HDRI-Studio and is a panoramic image of a professional photo-studio set-up. It’s a nice quick way of getting a real photographic look without much configuration or knowhow.   

But by definition, the image based lighting set-up uses a static image to generate both the lights and reflections you see on your display. Without the ability to move the IBL, you can’t really move the lights. They are one and the same.   
Inevitably, there are things about the light set-up that don’t suit the image. I’ve outlined a few things in this image that didn’t suit me. Aside from the details highlighted – one of the main features of this particular IBL image is the warm/cool lighting. From this vantage point, the face of the product is getting the full brunt of the blue-tinted light.
My workaround is pretty simple – I group the model geometry to the 3D view’s camera.

Now when I select the top level of the group, I can rotate about the z-axis and the model and the camera spin in tandem. The visual effect though is the opposite – it looks like the IBL image is spinning and now I can find my perfect lighting set-up. Below is the mouse shortcuts from the Alias manual. I use the right most mouse button to constrain my object rotation to just the z-axis. (You can rotate about other axes, but if you are using the reflection plane in your shaded view, you’ll get undesirable results because the plane itself is locked to the world coordinates – much like the IBL – and not the camera and/or the object.)   
This movie should illustrate the effect. Keep in mind, it’s the model and the camera moving, not the lights…  
Click to See Movie


After finding an angle that best shows off the form and materials, I can tweak my tone-mapping controls, make any last minute shader adjustments and I have a final image.

 

Another nice thing about this set-up is that the camera “eye” is still free to move within the 3D viewport. So I can navigate to the back of the product, then select the top level group again and adjust the lighting and I have an instant other view.   

This whole image (not including the documentation) took less than an hour to set-up and output.

Give me a brake…

Friday, July 13th, 2007

Ok, the real name of this post is “faking anisotropic shading for real-time rendering applications”, but that made even me yawn. But that’s what this post is about. It’s the first, in what I hope to be a series of tips and tricks revolving mostly around Alias Studio. I’ve found the documentation out there limited at best and this is my opportunity to give a little.

Just to set the expectations low – I seem to be blogging about once a month. So for what it’s worth – that’s my pace. On the other hand, if there’s anybody reading out there, please feel free to drop me a comment and let me know what you’re interested in and I’ll see what I can do.

So, when I was creating the shaders for the car renderings I posted about a while ago, I encountered a particular problem. One that I’ve encountered before, but never had the planets align to solve. Much of what I learn involves planets aligning and this time was no different. The problem was how to create a convincing anisotropic reflection effect that looks cool while tumbling the model live on the screen. If you’re not sure what this is all about Neil Blevins has a good explanation on his site here.

When I went to create a shader for the brake rotors, initially I used the same soft-chrome looking shader I created for the little rivets around the hub (and incidentally, this is the same shader the is used for the overall spoked portion of the wheel). It is just a basic Phong shader with the shininess turned down (broad highlights) and the reflectivity off to give it that bead-blasted look (no crisp reflections). But look at what I got on the rotor. Compared to the rivets, it was totally flat! Which makes sense I suppose, because the rotor itself is just a simple cylinder which is, well, totally flat on the ends.

While I was thinking about the problem, I started trying things. Things like using photographs to simulate the look – which works for static images, by the way, but I think it looks funny when you tumble the model. It’s a static image and thus loses all the luster of a real spun metal disc. Another approach was to use a bump map to actually create the tiny grooves on the surface of the rotor to get the effect. That has never worked for me – real-time or other wise. I consider it a brute force approach which tends to result in brutish end results.

I wanted the effect of an anisotropic reflection – not a physically accurate model of one. Of course, the answer was right in front of me. The hub portion of the rotor had a very dynamic highlight that responded to light in a very interesting way when the model was tumbled. The hub portion of the rotor was conical in section. The effect of light on metal with tiny circular ridges on it is also conical. So when in 3D rendering is the effect of a highlight in direct opposition to the surface geometry? When you use a bump map!

So, I added a simple ramp to the specular channel of my shader and got this. Sweet! It’s just a simple black to white ramp that follows the U direction of the surface. Since the end cap of the cylinder is essentially a revolve, the UV directions are circular and thus the ramp essentially shades the end cap like it was a cone – resulting the effect I wanted.

From there I started building a layered shader. The base layer was a simple gray Lambert. This would allow me to control the overall tone of the rotor. The next was to take my ramp-modified shader and tune it a bit. I made it 100% transparent with no color, no diffuse or anything else other than the specular with the bump mapped into it. Tweaking the shininess of the Phong shader controls the amount of “splay” in the highlight, while the intensity of the bump map controls the, um, intensity. I ended-up using a huge value (1000) for the intensity. This makes the virtual bump mapped cone quite tall. This may be somewhat related to the fact that I’m just using the default “Abstract IBL” rendering environment for this example – this scene just has a really strong single light coming down from the top. I’m sure if I used a scene with more complex side lighting, the value may not have to be so high.

As an experiment, I duplicated the anisotropic reflection shader I just made, layered that on top of the others and set the intensity of the bump map to -1000. So now I have two ramps layered on top of one another – one with a positive value and one of an equal, but negative value. This made the highlight symmetrical on either side of the center axis. It is hard to show in static images, but as you rotate the model, the effect is more obvious.

Lastly, I added yet another layer. This one has an image map of the cooling flutes. I used a solid projection for this. Three actually. One in specular to choke the highlight out of the holes, another in transparency to prevent the anisotropic shaders below from shining through and one as a bump map to get a highlight around each edge (this map had been blurred in Photoshop).

Here’s a slightly different view that shows how the conically shaped highlights travel across the rotor.

That’s it! I hope you enjoyed this first whack at a tips and trick series…       

Cheers,
J.