Monday, 11 April 2011

Day 27

Basics: Mantra (By Peter Quint)

I completed his series on 'Lighting in Houdini11' the other day and did my own tests. Decided to watch another one today, saw the video as state above and thought i might pick up something new and reinforce my knowledge on Mantra although it's basic & at the same time type out the useful points shared by Peter Quint over here in my blog.

Micropolygon rendering is based on REYES algorithm (Renders everything you ever saw) which is the same as the algorithm used by PIXAR's renderman.

Step 1: Splitting
Splitting objects into more manageable chunks. How many chunks depends on the size of object and how close it is to the camera. This process is invisible to the users.

Step 2: Dicing
The chunks are diced into small 4-sided polygons called micropolygons. We can set how big these are but by default their size are less than 1 pixel in size when projected.

Step 3: Displacement
Now to run shaders on the micropolygons.
First shader would be the displacement shader, it is executed once per micropolygon and moves the micropolygon a little.

Second shader is the surface shader, which sets the colour and opacity of the polygon & are also run once per micropolygon. Although running these shaders on every micropolygon may sound time-consuming, but it was made efficient by using a computer technique called 'Single Instruction Multiple Data' (sounds like Computer Science).

The shader is being run on a grid of micropolygon at once, when you write the shader, you do it as if it is doing it to a single micropolygon.

They also have access to any attribute you define on the object being rendered, e.g. Point Colour.

Sampling Controls
There are at least 3 sampling controls available.

1) Pixel Samples
This is found in Mantra > Sampling > Pixel Samples (by default 3 x 3)
Rays are being shot out at the scene, some of them may hit the micropolygon of an object while some might hit the background. The colour of the pixel is average of the colour of the samples.

Note: This is also used for reducing the amount of noise in motion blur and depth of field effect.

Important note: Pixel Sampling doesn't control the amount of times a shader is run. The number of samples does not affect the number of micropolygons, samples are just camera shooting rays at the micropolygons in order to sample them.















Visualizing Micropolygons

We'll need to create a simple shader to make this happen.















2) Shading Quality
The actualy place to set the Micropolygons per pixel can be found in Object's Render Tab > Dicing Subtab > Shading Quality = Micropolygons per pixel.

In the screen capture above, mine was set to '0.1' meaning a micropolygon is 10 times bigger than a pixel making them very obvious in the render. A value of '2' equals 2 micropolygons per pixel meaning the shader will be ran twice for each pixel (As mentioned previously, shader is run once per micropolygon) increasing the quality of your shading.

Note: It is usually much better to address the issue of shading quality within the shader itself by providing sampling parms there.



3) Ray Variance Anti-Aliasing
Mantra > Sampling > Min/Max Ray Samples
(This only applies to micropolygon shading modes, doesn't apply to raytrace Mantra renderers)
This is to determine how many rays are shot out to calculate reflections and refractions.
Ray Variance = Sampling for reflections

The amount of rays sent out depends on what those rays hit, if they hit a simple BG (Solid Green) like the first image. There would be no need to anti-alias the result, so only a single ray would be sent out.






If it was a more complicated BG, where each ray is returning a different colour. Mantra would send out something near the Max Ray Samples.









That was all from the video, took time to watch & compile all these but didn't regret doing it.
This is the video, http://vimeo.com/7612064



PBR I (By Peter Quint)

The way to control sampling varies when using MPPBR & PBR.
In PBR, 'Pixel Samples' control everything like quality of shading, quality of motion blur & quality of geometry anti-aliasing.
In MPPBR, 'Pixel Samples' only controls the anti-aliasing of motion blur and geometry, if you want to smooth out the shading, you have to increase the 'Max Ray Samples' parm.

PBR III (By Peter Quint)

Most of what was being explained in the video had already been introduced to me in the earlier stage of my R&D.

- Used of IPR to view PBR renders

- Recap of PBR shaders (BSDF output, a must in order to work with PBR)

- Displacement shaders and bounds.

PBR IV (By Peter Quint)

In here, he was addressing PBR problems such as double reflections. First was coming from 'Specular Intensity' within the material & second was from Reflection. (Have doubts, writing it down now)

Another was inspecting value of pixels using the inspect cursor which can be found both in Render View & mPlay. Specular highlight may appear very hard and jaggy in the window but there could be pixels which have lower values despite being displayed pure white. The reason was because all these white pixels are above the value of '1'.

In cases where you want to use Tone Mapping feature from other compositing software (Houdini COPs don't have this) to adjust the specular highlight, you may want to preserve this hard highlight and save it as 16bit/32bit float format.

Found a place with Houdini COP2 Tone map (by Michael Rice, he also has this PhysX Solver and Bullet Physics video breakdown which looks insanely good!)

Haven't tried it but here's the http://audenmedia.com/michael/?p=59

If you don't intend to do the first method and like to tone down the highlight in Houdini, You can follow these steps below.

- Mantra > Edit Rendering Parms > Install 'Colour Limit' parm > set to '1.5' & rerender.
(Now you will see that the brightest pixel in the highlight is a value of '1')
Don't think you have to do this step since 'Colour Limit' is already there by default in Houdini11.

Note: you can also display the blur/soft highlight in Render View & mPlay via Colour Correction options and click 'Adapt to full pixel range' (This will dramatically darken the overall image).

No comments:

Post a Comment