Thursday, April 26, 2012

Vray render

Vray render
my first interior lighting & shading in max(vray).
There’s no special treatment in this scene. I used ready made model for all objects, some collection.I just modeled the wall and floor object using basic edit poly.
Lighting and Camera Setting:
There’s nothing special about lighting in this scene, I used 2 vraylights.

Tuesday, April 17, 2012

/3GB switch for window xp to tune the use of memory

The /3GB switch increases the size of the user process address space from 2 GB to 3 GB.
This can improve performance of servers that run virtual-memory-intensive applications. That is for example database servers. A larger address space can improve a database server performance.

What is the benefit of using the 3GB switch?

Depending on what software you run on your server, it might make sense to optimize the server memory usage. If for example you are running only a few memory extensive large applications that do not interact with the operating system but rather work on their own, you might want to consider implementing this switch.
The additional virtual address space that you give applications with the 3GB switch helps reduce the amount of memory fragmentation in the virtual address space.

Adding the 3GB switch is very simple. You first need to locate your machines Boot.ini file which should be located in the root of your main system drive. (Be aware that this file may be hidden and marked as read-only initially.) You will want to open this file in a program such as Notepad to edit it properly.

Alternatively, you can edit the boot.ini settings through the System Properties:
  1. Right-click on My Computer
  2. Choose Properties
  3. Click the Advanced tab
  4. Click Startup and Recovery Settings
  5. Click System Startup Edit
You will now see and be able to edit the contents of the boot.ini file. Click OK when done to save your edits.

Note: Before adding the 3GB switch, it is important to note that the switch is very picky, and requires that every device and driver on your system be fully WinXP compatible in order to work at all. If anything in the system is not compatible, Windows will not load at all when restarting with the 3GB switch activated. The only way to then remove the switch from the Boot.ini file so that Windows can load is to either mount the drive in another system and manually change the boot.ini file, or reformat the drive and re-install Windows. Both solutions are far from ideal.

To safely add the 3GB switch we strongly recommend adding a second instance of the OS in the boot.ini, and add the /3GB switch to that second version.

----- default boot.ini without 3GB Switch -----
This is what a default boot.ini file will look like. (This may differ from system to system.)

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro"

----- updated boot.ini with 3GB Switch -----
This is what the updated version should look like. Notice the /3GB that has been added to the second instance of the OS line.

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro"
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro with /3GB" /3GB

Once you have updated your boot.ini file accordingly and have saved the changes, simply restart your system for the changes to take affect. When your system reboots you will be given the option to choose either the standard Windows XP version or the 3GB switch enabled Windows XP version. If you choose the 3GB version and it fails to allow Windows to properly load, just restart your system and you will be given the two options once again, where you can then choose the standard Windows XP version to load. Either way, if it works or doesn't, you can then remove whatever line you don't need in the boot.ini file. Alternately, you may wish to leave both settings so that you can choose to boot without the 3GB switch should you ever have problems with drivers installed in the future. The boot loader will default to the first option listed in the file. So you may want to put the /3GB option first. You may also wish to lower the timeout value to something quicker so that you don't have to wait for 30 seconds or press Enter with each boot.

Note: The 3GB switch is only compatible with the following versions of Microsoft Windows.

  • Windows XP Professional (and greater)
  • Windows Server 2003
  • Windows Server 2003, Enterprise Edition
  • Windows Server 2003, Datacenter Edition
  • Windows 2000 Advanced Server
  • Windows 2000 Datacenter Server
  • Windows NT Server 4.0, Enterprise Edition

Sunday, April 15, 2012

Use background Shadow problem With Physical Sun and Sky


When you apply a Use Background shader to a surface, the Physical Sun does not cast shadows on the surface.


To cast the shadows, please do the following:
    1. Assign the Use Background shader to a surface.
    2. In the Attribute Editor for the Use Background shader, turn off reflection.
    3. Create a new Directional Light. You won't get the shadows with the default sky sun light. Put the new Directional Light above the original sun light and match the rotation of the original sun light.
    4. In the Attribute Editor for the new Directional Light, set the intensity to .3 and turn on ray traced shadows.
    5. Duplicate the new Directional Light, set its intensity to -.3, and turn off ray trace shadows.
      The two directional lights cancel each other out, so that the default sun light controls the amount of light in the scene.
Now shadows will be cast on the surface.

Saturday, April 14, 2012

Render Optimizer script for max 2012

I discussed progressive sampling in the previous post. Thorsten Hartmann and Artur Leão has collaborated on an "Über-script" for handling a ton of stuff. Torsten calls his variant "Render Optimizer" and can be found on this link:

The Render Optimizer does a lot more than just turn on unified sampling, and Thorsten has several tutorial on the various subcomponents.

If you are overwhelmed by the number of tabs on Thorstens version, Artur also independently has a slightly different version on his site, called "mr Options Manager", which you can find here:

by Zap's mental ray tips

physical_light and areaLight

Today I read a post on CGTalk that brought to my attention something I hadn't noticed before about area lights and mentalray. Prior to maya 8, if you wanted an area light in mentalray you would start with a spotlight and set some attributes to turn it into an area light. This changed in maya 8 where the maya areaLight now has a mentalray section with a bunch of new attributes.
The thing I had not noticed is best explained by showing some renders.
The first picture, which I will use as a comparison, is rendered using maya software renderer with raytraced shadows. An areaLight has been scaled into a thin rectangle. (I have positioned a white polygon to give a visual reference of the light's position). The illumination does not look very realistic given the shape of the light.
Here is a snapshot of the areaLight's attributes. Notice that I have set quadratic decay to simulate that of a real light.
The second picture was rendered using mentalray and I simply enabled the mentalray area light with the "Use Light Shape" flag. (The white polygon is no longer required since mentalray area lights can be flagged "Visible".) This is worse than the software render - there appears to be no relationship between the shape of the light and the illumination.
Here is a snapshot of the mentralray tab in the areaLight's attribute editor.
The thing is that the walls are brightly illuminated, with a sudden cut off at the height of the light. It is as if the areaLight is extending to infinity and ignoring the shape of the light!
Fortunately the solution to this problem is a simple one. You need to use a mentalray physical_light shader, which you simply connect to the "Light Shader" slot in the "Custom Shaders" tab of the areaLight's attributes.
The third picture is a mentalray render using an areaLight with a physical_light as the light shader. This is a much more convincing result.
The physical_light has it's own set of attributes with take over most of the funtionality of the areaLight. So here's a snapshot of the areaLight attributes.
and the physical_light attributes.
Note that the color swatch is used to set the intensity of the light as well as its hue. In my render I set the luminance value of that swatch to 10,000.
The "Cosine Exponent" can be used to control the spread of the light. It is interesting to note that setting it to 0.1 gives a result similar to the render without the physical_light connected. A value of 5.0 makes the light very directional with almost no spread at all.
One more thing. If you go to the trouble of hooking up a physical_light you can get a little bit extra for almost no cost. Make a few copies of the areaLight and hook up the same physical_light to each copy.
This is what it looks like rendered using mentalray with three areaLights that share a single 
 physical_light as the light shader.


mia_physicalsky and haze

A while ago I learned from one of "Zaps Mentalray Tips" that the mia_physicalsky haze parameter could be used to make clouds in the sky by connecting a file texture to it. Since then I have experimented with this technique and discovered some limitations and some solutions to those limitations.

I am assuming that you already know how to set up the mia_physicalsky environment. In my examples I am using the mia_photographic tone mapper in place of the default mia_exposure_simple. I have set the rgb_unit_conversion to 0.318 so we get the correct brightness for mia_photographic. I set the horizon height to -3 and the horizon blur to 1 so it looks like we are way above the ground. I made the ground color a bit blue instead of the default grey.
With no haze mapping I get this
Next I found an image of some clouds (small version shown here)
I loaded this image into a standard maya fileTexture node (with the usual place2dTexture node) and used the luminance value of the image to control the haze parameter of mia_physicalsky. The following image shows the hypershade connections.
I used a multiplyDivide node so that I could multiply the luminance (in this case by a factor of 9) to control the density of the clouds. Here is the result
Notice how I have not used any projection nodes like envSphere or mib_lookup_spherical. In fact when you hook up the fileTexture as I have shown here, the mia_physicalsky treats it as if it is mapped onto a hemisphere with the bottom of the fileTexture at the horizon and the top pinched in at the zenith.
If my cloud image map was a nice 360 degree panoramic one it would be perfect. But it is not. So to get it to fit nicely in the camera view I used the place2dTexture repeatUV and offset parameters (with a bit of trial and error to find the correct values).
So now I have clouds in the sky, but I also want the athmosphere to reduce the visibility of the distant objects. This can be achieved using the visibility distance parameter in mia_physicalsky (which requires that mia_physicalsky is used as a lens shader as well as the usual environment shader).
Here is a render with visibility distance = 100
It doesnt look too bad, but if you look carefully you will notice it added to the cloud reflections which is not what I want. If I lower the visibility distance the problem becomes more obvious.
One way to solve this problem is to create another mia_physicalsky node. The first one is used for the environment shader and has its visibility distance = 0. The second is used for the lens shader. In the lens shader mia_physicalsky the haze parameter is left unmapped and set to zero and has a visibility distance value to give the athmospheric effect you desire. Here is a snapshot of my 2nd mia_physicalsky attributes where I tweeked the look a bit. Remember it is only affecting the look of the visibility distance effect.
And here is the render
As you can see there are no extra reflections. Its a good solution, but now the clouds are always behind my objects. The depth muting effect is just a simple color. I wanted to see if I could get the actual clouds to partially obscure the objects.
Here is what I came up with. Instead of using the maya fileTexture I switched to a mentalrayTexture node. But that meant I no longer had the place2dTexture node for positioning my image. Well it turns out you can do the same thing with a few extra mentalray nodes.
Here is the hypershade network
And here are the attribute editor snapshots of each node
The important one is the mib_texture_remap (shown above) where I have highlighted in orange the parameters that behave like the ones in the maya place2dTexture node. These are the numbers you change to reposition the file texture within the sky sphere.
So if I put all that together I get a network like this
I have used 2 different outputs from the multiplyDivide node to connect my cloud luminance to the haze of both mia_physicalskys so that I can control the density of the lens shader clouds independantly of the environment shader.
Here is a render
I'm not getting the exagerated reflections that I got with the maya fileTexture and the clouds partially obscure the objects - but it is not very convincing! I guess this is a limitation of using the haze parameter for clouds and it is not a replacement for true volumetric clouds.
After a bit more tweeking I settled for this
The effect of the lens shader clouds is subtle, but I think that I would use this technique in a scene with objects fading off into the distance.
If you want a look at my set up you can download this example scene and the cloud image map I used.
BY david | mentalray

Imagebased light issue

when we use ibl lighting in maya 2011 there is a major issue that is lot of render solve this bug should use these settings
Note the very low U/V quality – the reason is, currently Maya 2011 there is a current bug with the mentalrayIBL node which causes your render time to sky rocket if you use settings above 7 x 7. There are 2 fixes one is to simply set your quality below 7×7 and bump up your samples in the render settings.
The other fix to add this additional attribute to the miDefaultOptions.

You can find Autodesk’s full bug report and solution on this page.
but after than another big this

 for this problem use following setting.....
enjoy image  based lighting......

tips for rendering maya fur with mentalray

I've been working on a project involving the use of maya fur. It's the first time I have rendered fur using the mentalray renderer, so there was much to learn. One of the difficulties I encountered was dealing with the illumination of near-white colored fur (like a polar bear). In the past, using maya's native software renderer, I would have added fur shadowing attributes to my lights to allow me to control and balance the amount of illumination on the fur, but these attributes are not supported by mentalray so I had to find another way.
In this post I show an approach to rendering near-white colored maya fur with mentalray.

I'll start by creating a torus to which I have attached a fur description with the polar-bear preset. I have two spotlights for illumination. Here's a top-view snapshot of the setup.
I want my fur to be almost white, so the underlying surface needs to be faily pale. I'm using a simple cream colored lambert with some ambient color to brighten it up.
I want to achieve a soft look without any shine so I started with the polar-bear preset but changed the Light Model to Ambient + Diffuse (so no specular component). And I set clumping = 0.
If I render it without changing anything else I get this.
This is using the standard scanline/raytrace render method, not the rasterizer, and it took 1 min 30 secs (I'll use this time for comparison).
Tip #1: Change Fur Shader from Hair Primitive (default) to Volume in the mentalray section of the Fur Render Settings. Here's what it renders like.
And this only took 16 secs (thats six times faster!).
I want the fur to be even whiter than this so I added base and tip ambience to brighten it up.
Which renders like this
This is closer to the color I want, but now the fur looks too bright and its luminance is clipped harshly at the top end of the luminance range. Lowering the intensity of my lights would prevent the clipping, but then everything else would be too dark and my fur would look dirty.
Tip #2: Use a tone mapper. I used mia_exposure_photographic as a lens shader attached to my camera. Here is a snapshot showing the exposure attributes.
The Cm 2 Factor setting makes all the other attributes work in the desired exposure range. I reduced gamma to 0.5 to give me a bit more contrast between the whites and the near-whites. And it now renders like this
Tip #3: Play with the Shadow Density Scale in the furDEscription's Volume Fur tab. By increasing this from the default 0.125 to 0.5 I get nicer fur shadowing.
Tip #4: For the underlying surface use incandescense instead of ambience. This will eliminate the darkness of the shadows that the fur makes on the underlying surface. So my lambert looks like this
Well I'm pretty happy with the color now, but the over-all look is a bit dull. Some tasteful burn out will give it the appearance of a bit more dynamic range so I increase the exposure Burn Highlights from 0 to 0.03 and here is the result
Have fun with fur. There is so much to experiment with.

p_HairTK, p_HairTK_shadow, p_shader_replacer

These 3 custom mentalray shaders are part of an extensive shader collection written by Pavel Ledin (aka puppet). In this post I will show how you can use a geometry shader, p_shader_replacer, to assign the p_HairTK shader to maya fur when using mentalray with fur mode set to hair primitives. Doing this gives you much more control over the look of the fur and, depending on how you use it, may dramatically improve yoru render times.

First you need to download and install the latest version of "shaders_p" from puppet's web site. Currently its v3.3 beta 9, but it seems to be very stable. You will not see p_HairTK mentioned on puppet's download page, but it is included in the package.
Then you need to create a surface and add some fur. In my example I have used a torus called pTorus1.
Next you must create an instance of the three shaders: p_HairTK (Material), p_HairTK_shadow (Shadow Shader) and p_shader_replacer (Geometry Shader).
Geometry shaders, like p_shader_replacer, are actually less like shaders and more like plugins which enable access to features within mentalray that maya cant normally get to. You don't assign a geometry shader to a surface like you normally would. Instead you hook it onto a piece of geometry using a slot in the transform node. This host geometry can be a simple poly or nurbs surface. It will not be visible in a render. It's only purpose is to be a place to plug in the geometry shader.
If your fur is attached to a poly object, then the geometry shader host needs to be a poly object. And fur growing on a nurbs surface requires a nurbs host for the geometry shader.
So if you follow my example and attach fur to a poly torus then you need to create a poly object to hold the geometry shader. This can be any poly shape, but keep it simple and just use a default cube.
Select the cube (transform node) and open the attribute editor. Drag-and-drop the p_shader_replacer into the geometry shader slot as shown here

Remember, the sole purpose of this cube is to hold the geometry shader. With the geometry shader connected the cube will not be visible in the render, but it must remain visible in the scene or the geometry shader will be ignored at render time.
When you created p_HairTK1, then a shading group called p_HairTK1SG was also created. Select the SG and use the attribute editor to hook up the p_HairTK_shadow as shown here

Now select the p_shader_replacer node and use the attribute editor to enter the names of the p_HairTK1SG and FurFeedback as shown here

Notice that you must enter the name of the shading group, not the material. And the name of the FurFeedback transform node, not the shape node. You can drag-and-drop the SG node, but you will need to actually type the name of the FurFeedback (or copy and paste).
Everything is now connected and ready to adjust the shading attributes and test render.
P_HairTK takes over the job of shading the fur, so it makes all of maya's native fur color attributes redundant. Here is a snapshot of the maya FurDescription attributes (I used the raccoon preset and made it pink)

When p_HairTK is hooked up all of the color and opacity attributes in maya's FurDescription are ignored. Shading is then controlled using the p_HairTK attributes. They are extensive as you can see here.

The p_HairTK attributes shown above are default settings, with colors changed to match the pink raccoon shades and the Use Ambient flag disabled.
I have also left the p_HairTK_shadow attributes as default

As you can see, p_HairTK dramatically increases the control you have over fur shading.
I'll finish off with some render comparisons. I've used a single spot light with a mentalray physicalLight/mib_blackbody. I've enabled finalGather and connected mia_exposure_photographic as a lens shader.
The first image is maya's native FurDescription. It took 2 min 34 sec on my q9550.

Next is p_HairTK/p_HairTK_shadow with Transparency disabled. It took 30 secs.

And then again with Transparency enabled with values matching those in the FurDescription . This took 1 min 4 secs.

Of course I could adjust attributes and make nicer pictures, but the intention of these renders was to quickly compare default settings.
I like the considerable speed up I get with p_HairTK. I also like the extra control it gives me. I've barely scratched the surface in this quick example but I hope I've given you a taste of what's possible with puppet's p_HairTK.