Category Archives: 3D

Mental Ray | Illustration | Ambiant Occlusion VS Global Illum.

Lately I had the opportunity to test Mental Ray. In MR 3.4 I found “Ambiant Occlusion”, a shading tool that is becoming a true alternative to Global Illumination. Amb. Occ. is nothing new to CG, but it last implementation in Mental Ray comes with a lot of handy parameters :

  • sampling rate : quite obvious, will determine the amount of rays cast by the shader
  • spread angle : will make the probing from narrow to wide angle, thus more or less sensitive to the details around
  • distance : a critical parameter that define the probing range from near to far

Among them, Distance is a real breakthru against Global Illumination. Small probing distance make shorter render times (more than 200% in some cases). And it gives subtles areas of shadow.

Of course, it doesn’t take account of the “boucing energy” phenomenon. Fortunately that’s the funniest part of the lighting job : adding pointlights here & there to mimic the bouncing of light. That what I did in this scene.

In the end, hires render time came under 2 minutes (VS 8 minutes for a full GI solution with LW)

Mental Ray | Rusty Metal

I was looking for some rusted metal shader for a scene I’m working on and I wanted it to be fully algorithmic, no bitmap at all.

The main idea is to have blurred reflection with some dusty bumps in the less accessible areas. This require several component to be layered : diffuse, noise, ambiant occlusion, blurred reflection …
I see many benefits in algorithmic shading :

  • small memory impact
  • no interpolation artifact
  • no more tilling issue

Here’s how it works, in pseudo-code :

amb_occ = ambiant_occlusion("cone=wide","distance=small","fallof=high"); C = diffuse() * noise("grey","orange") * amb_occ; C += specular() * noise() * amb_occ ; C += reflect("blur") * amb_occ ;

Quite simple, eh ? 😀

Render details (Mandarine)

  1. Despite the very low amount of polygons, it is always possible for a model to catch the play of light
  2. Darker areas sometime claims to be colored. This can be observed with traditional medias, especially on sensitive color films
  3. Depth of field will blur the unwanted details, as long as the shapes remains readable, and will enable you to composite a texture layer

Doctor Atome, freaky sci-fi from 50’s

This scene uses a strong backlight, as a tribute to the earlier sci-fi movies. The first step was to setup dark silhouetes on a light background, then add a backlight so that shadows will be running accross the camera, and eventualy recreate the bouncing of light to emphasize the characters’ features.

Fresnel reflexion created a slight transition around the silhouetes. An arealight casts soft shadows (but in this case a pointlight with sharp shadows will probably works as well), and spotlights here and there were usefull to trace the bouncing of light. Using radiosity here would have been hard to control and probably far less accurate.

To sum up I would say that playing with violent contrasts, orange eyes versus a dark head, helps to suggest a menacing robot.

Tank scene by day

The modeling of this scene was very quick, for I wanted to focus on lighting, as always . It simply consists of some poles in a field, around a roughly shaped tank.

  1. The funniest is : there’s only one light on this scene that suggests a raising sun and casts rather long shadows. The blue backlight seen on the tank and the robot is pure reflexion of the blue environment. Eventually, I used a strong blue fog to give the scene its overall color and to strenghten the tank agains the background.
  2. Adding grass was an obvious choice to me, for it really catch the play of light.
  3. As the final render seemed too blue, color corrections on high colors proved very useful to achieve a warmer lighting.

Mental Ray | Hair & Fur

Mental Ray Hair & Fur
Testing Max 7SP1 = Mental Ray 3.4 + Shave & Haircut, I just found a lot of nice features :

  • generate geometry, thus can be combined with ambiant occlusion
  • conform fur along a spline, reminds me Worley-Sasquatch, with more feedback
  • tickness spinners are locked to max = 100% but it can be overrid with a texture slot
  • physics enabled (didn’t tested it)

‘Tried it with ambiant occlusion & baking. Damn ! It rocks.

Making of “Caillou”, lone robot in a forest

This scene was primarily designed for a realtime toon rendering. Thus the modeling is very simple, with few polygons and square-looking shapes. Later on, I decided to render it as if it was a realistic scenery, featuring little toys.

First of all, I played with depth of field to suggest the small scale. Most of camera lenses can hardly shoot a sharp image of the whole scene, so the foreground and the background are often out of focus.

Secondly, I used the same texture basis on each material of the scene, to have a coherent overall look :


Figure above shows the process :

  • Flat shaded geometry is usually dull. I needed something to texture the shadows : a hand-painted layer was camera-mapped onto the scene, with a slightly different angle than the viewpoint
  • It’s very powerful because it’s more than a simple 2D layer and you can move freely around the viewpoint without too much distortion. But this layer is hoverwhelming if you don’t modulate it with the luminance of the initial render.
  • Eventually, I just did some levels tweaking to get colored shadows and obtain a far more interesting result.

These are the techniques involved in the creation of this scene. Everything in this process is done with animation in mind, so that I could easily redo it on an image sequence.

  1. Textured scene + shadow map spotlight
  2. HDRI-based skydome
  3. Composite of the 2 previous passes
  4. Color corrections

RenderMan | Poor Man’s Dispersion Shader

I decided to write this shader after I found this thread on usenet : Poor Man’s Dispersion
It describes a simple way to mimic the dispersion of light such a complex medium such as crystal.

The main idea behind is to cast 3 rays of refracted light instead of 1. Each ray will have a slightly different index of refraction (IOR). The 3 resulting values will be recomposited in the red, green and blue component. This is absolutely not physically accurate, but it works quite well, as seen in the figure below (both images were rendered on a RenderDrive).

  1. As mentionned in the newsgroup, this straight method gives three sharp streaks, instead of a continuous spectrum.
  2. That’s why we need to add a rand() function to the IOR offset. And here comes the magic of the RenderDrive, that will automatically supersample each raycast until it sufficiently reduces the noise.

Here is the RSL source of the shader. It uses raytracing extensively, please don’t expect amazingly short rendertimes.

surface PoorDispersion(float ior = 1.5; float dispersion_iota = 0.25;) 
{ 
	point R, T, Nn, Ni; 
	float krefl, ktran, eta; 
	
	Nn = normalize(N); 
	Ni = normalize(I); 
	fresnel(Ni, Nn, 1.0 / ior, krefl, ktran, R, T);
	
	if (isshadowray() != 0) 
	{ 
		Oi = (1.0 - ktran); 
	} 
	else 
	{ 
		eta = ior; Oi = Os; 
		eta += (dispersion_iota * float random()); 
		T = refract(Ni, Nn, 1 / eta); 
		Ci = trace(P, T) * color(1,0,0) * ktran; 
		eta += (dispersion_iota * float random()); 
		T = refract(Ni, Nn, 1 / eta); 
		Ci += trace(P, T) * color(0,1,0) * ktran; 
		eta += (dispersion_iota * float random()); 
		T = refract(Ni, Nn, 1 / eta); 
		Ci += trace(P, T) * color(0,0,1) * ktran; 
		Ci += trace(P, R) * krefl; 
	} 
}

Later on, I tried this shader with the former PRman implementation of Larry Gritz : Entropy. I made a quick comparison :
3. RenderDrive demonstrates its ability to handle crazy raytrace
4. With Entropy the result is really noisy, I should reconsider the brute force approach

Kenet’s room, 3d-painting a room

This is one the most achieved layout with “pictural rendering”. By this I mean a computer generated image that is rich enough to convey a story, whereas the amount of details doesn’t trap the eyes.

There is a technical breakthrough (re?)discovered by painters of the Renaissance, known as sfumato, where color is blended and overlaid to create atmospheric depth and volume.

I tried to re-use this technique, with the tools of today’s CG softwares. The compositing steps below speaks for themselves.

On a technical point of view : depth of field, color corrections and camera-mapped textures help me to keep mystery without loosing readability, hide the details that are not needed to understanding and bring matter and texture to strengthen a certain mood.