Wednesday 18 December 2013

Daylight Scene in 3D max

This tutorial shows you the basics of how to set up daylight lighting in V-Ray using VRaySun and a 3ds Max daylight system for precise control of time of day and location.

In this tutorial we will start by lighting our scene with a VRaySun inside a 3ds Max daylight system in order to have accurate time and location control.

1 . Switch to top view and go to the create menu > systems > daylight system. Now click and drag a daylight in the center of your scene.
2 . Now we need to change the settings of the Max daylight system so that it uses a VRaySun to light our scene. Select the daylight system and in the modify panel select VRaySun from the Sunlight dropdown menu. Accept the request to automatically add a VRaySky environment map. We will be using the automatically created VRaySky environment map to light the scene, so we also need to disable the Skylight. Select from the Skylight dropdown menu.
3 . We can now use the daylight system to accurately position our VRaySun and we do so by clicking on the setup button in the modify panel and then adjust our time and location to our needs. In this example I have set it to 15:45 and this gives me a low angel for the sun, thus creating a nice afternoon mood. TIP: Having the sun at close to a 90 degree angle will resemble 12:00 mid-day resulting in a brighter scene.

Before we go to rendering we need to adjust our VRaySun and create a VRayPhysicalCamera in order to have physically correct exposure.

4 .  Go to the VRaySun rollout of the daylight system in the modify panel, and select CIE Clear from the sky model dropdown menu. This setting gives you a few presets of physically correct sky models that will contribute to the overall lighting of our scene.
5 . Now in the top viewport create a VRayPhysicalCamera and point it at the object.
6 . Select the VRayPhysicalCamera and go to the modify panel and adjust the distortion to 0.25. This will curve the camera lens slightly just like the lens in real world cameras.
Then set the vignetting to 1.3 which will mimic an effect produced by the lens that darkens the corners of your image. This will help draw the eye to the center of the image. White balance is important because it will affect the overall color tone of the image, a light blue will balance the image and a dark blue will give us a more yellowish tone whereas a light orange will give us a cold blue tone. Feel free to play with this, and at the end of this tutorial there are a few images showing the effect of color balance. The last thing to set in the VRayPhysicalCamera is the film speed. The higher the value the brighter the image just like in real world films. This value represents the films sensitivity to light, and in this case we set it to 120
7 . If you render your scene at this point it will look like the image below.
8 . Lets quickly set the 3ds Max gamma setting to a Linear Workflow (If you haven't already) so we can get the correct colors. Go to the customize menu > preferences, and then select the Gamma and LUT tab. Check enable Gamma/LUT correction, and adjust your gamma value to 2.2 and set input gamma to 2.2 and output gamma to 1.0 .
9 . Now let's jump to the render settings. Press F10 to open the render dialog box, go to the VRay tab and enable built-in frame buffer. This will allow us to further control our exposure and colors after the rendering is done and will be a huge time saver. To ensure image sampling happens at the correct gamma level for our render we need to adjust the gamma to 2.2 and enable Don't affect colors(adaptation only). Unless we do this the image sampler will be using gamma 1.0 to determine if sampes are within acceptable noise thresholds, and we end up with a more noisy image when viewed at gamma 2.2
10 . Move to the Indirect Illumination tab and enable GI. For primary bounces we will use Irradiance map, and for secondary bounces we will use Light cache. This combination gives us a fast plus clean render. well… fast-ish .
11 . Now that we have chosen our GI method combination we need to adjust them, so go to the Irradiance map section and choose medium. Or if your computer is slow you can set it to low or very low and do a bit of compromising. Enable show calc phase, this will let you see the irradiance map while it's being calculated .
12 . In the Light cache section set the subdivs to 1500 and (or if your computer is slow set it to around 800, but not lower if you need a good quality image). Also enable show calc phase to see the light cache while it's being calculated
13 . We are done now, and you can render the scene. In the VRay Frame Buffer you have to click on the sRGB button to see the final result of our gamma correction. Also and notice that you can enable the curve editor by clicking its icon at the bottom of the VRay Frame Buffer window and then adjust the color to your liking. Remember to save your images in a linear format, like Open EXR, as this will ensure that the image displays correctly further down your pipeline (see image below). If you want to save to a format line PNG, TIFF or JPG you should change the output gamma in the save dialog to 2.2 to burn in the gamma.

And here is the final image:


I hope that you have enjoyed this tutorial and happy rendering .

Wednesday 20 November 2013

Create Cloud in 3D Max

Our first step is creating an atmospheric gizmo containing volume effect, and to create a VRayPhysicalCamera, a VRaySun+Sky system and set LWF (Linear Work Flow), in a metric scale scene. The last step makes it easier to handle large scenes.
Then Create the gizmo with Create> Helpers> Atmospherics > Box Gizmo and setting volume for a cloud layer: 6000x6000x300 meters. Next step: VRayPhysicalCamera.
All default params used, eccept reducted focal lenght, to achieve a grandangular emphasizing sky effect. Put in scene as shown to increase perspective look.
Creating light system is quite easy. go to Create > Lights > VRay > VRaySun, dropping light in scene. check yes to popup question to get automatically VRaySky map in 3dsmax Environment.
Use default VRaySun params. Take a look at VRaySky map included in Environment map slot, and further selection in VEF.
Now in 3ds max "Environment and effects" module (press "8") we add VEF effect. Following default params:
1st rollout, General parameters, manages main effect params.
2nd modulates some features with maps. We're getting clouds adding map to density slot.
3rd rollout links VEF to the related gizmo, that can be shaded by user-defined lights. Step one: link VEF to gizmo.
Click Add to select gizmo from scene..
Resulting render. not our best!

We see gizmo is "full" of dark and dense fog, so light cannot penetrate it.
Adding texture to density channel we can modulate density areas. Use Noise map with following params:
Noise params used for clouds
Following final render parameters:
Params for VEF appearance and quality. Thanks to three slots, we meet great flexibility.

More than the other parameters, step size affects render times. Increasing this value decreases render times, trading off render quality.

The final render:


Leaf texturing in 3d Max

How to make leaf materials for 3d trees using the VRay2sidedMtl, in this case a sugar maple (in autumn). The tutorial uses Onyx Tree for the tree generation, but this material technique works just as well with other tree objects with low-poly opacity mapped leaves.
1.  Firstly, some observations on opacity mapped leaves vs. geometry leaves. As you can see in the image above, the images in this post were made using opacity mapped leaves.  Its true that in simple scenes trees with geometry leaves may render quicker as V-Ray doesnt have to calculate the opacity of thousands of leaves, but in dealing with complex scenes with millions of polygons the advantage in using (a lot) less RAM is huge.

2 . Exporting from Onyxtree. I went with 4 polygons per leaf so that the leaves aren't just flat. Remember to set the dimensions you want the individual leaves, and change the units when you export. You can also make it export 3 different leaf IDs with varying sizes. I normally export as a .obj file.
3 . Opacity mapping. It's important to make sure the opacity map is just pure black or white, with a sharp edge. You should also turn off filtering in the bitmap loader options.

4 . VRay2sidedMtl. V-Ray's 2 sided material works best with geometry that has no thickness, which is what onyxtree outputs. It is a very quick way of generating a SSS (sub-surface scattering, think candle wax, skin, milk etc) type look. The image below  is rendered using a VRay2sidedMtl on all leaves with grey submaterials and a hand drawn image for the vein skeleton.

5 . Front material. The front side material is a basic vraymaterial with a diffuse map and a reflection map. The color correction map is to produce slightly different hues of leaf for each of the 3 sub leaf types (you should have got a mult-subobject material when you imported the .obj file). I usually make the first leaf and then copy and paste it to the 2nd and 3rd and just change the hue value slightly. The reflection map is a b&w copy of the diffuse map with levels adjusted to make it more contrasty.

6 . Back material. The back material is a copy of the front material but with a different diffuse bitmap and no reflection. Note that I overlaid the veins skeleton jpg on top in photoshop as well. (without it, the veins looked too light when viewed from the underside as they took 100% of the lighter back material)

7 . Finished result Click image for 800px version. Rendered using VRaySky and VRaySun, and a VRayPhysicalCamera.

Image Opacity / Transparency in CSS

First we will show you how to create a transparent image with CSS.
Regular image:

The same image with transparency:
Look at the following CSS:
img
{

opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}

IE9, Firefox, Chrome, Opera, and Safari use the property opacity for transparency. The opacity property can take a value from 0.0 - 1.0. A lower value makes the element more transparent.
IE8 and earlier use filter:alpha(opacity=x). The x can take a value from 0 - 100. A lower value makes the element more transparent.

Example 2 - Image Transparency - Hover Effect

Mouse over the images:
pic
{

opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}
pic:hover
{

opacity:1.0;
filter:alpha(opacity=100); /* For IE8 and earlier */
}

Friday 15 November 2013

Sunday 10 November 2013

CSS Layers

With CSS, it is possible to work with layers: pieces of HTML that are placed on top of the regular page with pixel precision.

The advantages of this are obvious - but once again Netscape has very limited support of CSS layers - and to top it off: the limited support it offers is quite often executed with failures.

So the real challenge when working with layers is to make them work on Netscape browsers as well.
First look at this example:


Second look at the code:

Float columns with clear

Then after the floating elements we can "clear" the floats to push down the rest of the content.

.div-1a {
 float:left;
 width:190px;
 height:200px;
 background:#F03; }
.div-1b {
 float:left;
 width:190px;
 height:200px;
 background:#0CF;
.div-1c {
 clear:both;
 color:#333;
 background:#FF9; }


div-1a
div-1b
div-1c

How to create input type password

You just copy and past this....
<input type="password" name="pass" placeholder="Enter your password" />

Monday 28 October 2013

Grass tutorial in Maya

Open Maya and create NewScene. I use the HotBox coz this is the best solution for me to navigating through Maya interface.
Next we need to create sum geometry to paint on it, coz PaintFX will be created on curves on surface. Create NurbsPlane. Scale it a little bit so ya get sumthin' like that.
There are few diffrent ways to create PaintFX. Ya can paint direct on surface using Brush tool, then brush tool will create curve on surface or you can create curve on surface and attach brush to curve. In this tut I choose second way.
To make surface live, select it and click big red magnet on status line.
Now the surface is live and you can draw curve on it.
Choose Create - CV Curve Tool and click little box near it. This is an option box. Now in CV_Curve_Options click ResetTool and Close it. This was for setting 3 degrre cubic curve.

Now you get the diffrent pointer. So draw the curve on surface. Make it 8 spans or sumthin' near that number.
You should get something like this on pic.
Click again MakeSurfaceLive, I mean BigRedMagnet and you'll back to normal shaded mode.
Now it's time to select proper brush. We wanna create grass. So open up the Visor and look around what kind of grass there are. Visor is in: Window-GeneralEditors-Visor.

And here ya got Visor.
With brush selected, select curve on surface.
When ya choose brush from Visor ya'll get diffrent kind of pointer, sumthin' like red circle. This means that you are now in PaintFX mode. But if you wanna select curve on surface you shoul back to normal pointer mode. For that just click "Q" button on your keyboard and if you wanna back to PaintFX pointer just click "Y" on your keyboard.
If you got problems with curve selection coz this is curve on surface and you can select both curve and surface, solution are SelectionMasks. You'll find'em on StatusLine, look at pic.
Click: PaintEffects-CurveUtilities-AtachBrushToCurve. So now stroke curve with selected brush is on curve on surface. If it liitle to mass to understand you can open up Hypergraph to see all conections, like on pic:
Tips: if after attached brush to curve. Your grass is really tiny then ya should do sumthin' like this: you should see PaintFX pointer - red circle. If don't see it click "Y" on your keyboard. Than press ans hold "B" key and move your mouse, this is an interactive size changing for FX pointer. So make it bigger and try to attach your brush again to curve.
You can find Hypergraph in: Window-Hypergraph or just make a hotkey for that. I got hothey for Hypergraph under alt+G buttons. It's depend on you.
In Hypergraph select: grassWindWide1 node -this is your brush- and open the AttributeEditor.
In AttributeEditor change the values like here: BrushWidth: .8, StampDensity:12, Segments:12.
There is about 300 parameters in PaintFX, so don't panic if your first grass looks so simple but with sum patience you'll get more knowledge about that powerfull tool.
Well, I think it's good moment to make prewiev render. So open the RenderGlobals and set sum of the attributes.


RenderGlobals window. Now create the SpotLight. Choose menu: Create-Light-SpotLight and bring AttributeEditor to see it attributes.
Set the camera in proper place and Render scene. You should know where the Render button is if not check the Maya's docs. You should get sumthin' like this. Not bad for dumb maximum simple grass huh.
You can also add sum environment to your scene, sum fog or sumthin'. So open once again RenderGlobals and set attributes like that.
Then click black arrow on the right near EnvironmentFog. Set like this one.

Now ya should get similar to this one. Don't worry if your stuff doesn't look like this coz this is just brief overwiev of PaintFX. The main reason for making this tut was make ya a little bit unappreciated with Paint FX techniques.
R ya still there?? Don't sleep? Ok. So we got simple grass. Oh I forgat about rendering, the render time is: 49s on 640x480 with ProductionQuality. Next we add some dynamics to our grass and will animate it.
In GrassWindWide1 node go to Turbulence tab and set attributes like on pic below or close these values.
This added sum wind turbulance to grass. Just click Play on timeline and see what happend.
This added sum wind turbulance to grass. Just click Play on timeline and see what happend.