Wednesday, 21 May 2014

3dsmax: House texturing

: H o u s e T e x t u r i n g :

This tutorial will show you how to texture a scene. I will try to do a simple texturing job on a complex scene (a lots of objects). So the whole texturing is going to be done only in 3DStudioMax.
 The main problem is that we are going to texture an architectural scene. Surfaces on scenes like this are big. For example, part of front facade, left of the entrance is 5 meters (16.5 feet) wide and 7 meters (23 feet) high. So if you want to texture it with bricks, that's one hell of a big brick map. And the biggest brick map I ever so was 3 meters (10 feet)in with and 1.5 meters (5 feet) high, so even with this one there are going to be some repetitions. So its up to you to make that repetitions as less visible as you can.

When I first get my hands on Total Textures I was delighted. I spent just couple of hours browsing trough those maps. These maps are great, especially for close up scenes, but can they be used on big surface scenes. You bet they can.....I will try to texture this scene just by using Total Textures.

This is the scene properties. On the left see a perspective view of the scene. A House. There is only one omni light lighting the house, but you can insert a few more to lit it more and see better what are you doing with textures. Do not forget to delete those extra lights before rendering.
The first thing I done was to apply a texture to that big surface left of the entrance. Used a standard max material, with re014.jpg map (total texture V.3) in diffuse slot. What I got was big ugly dirty red wall. To calm it down a little tile it U=2, V=2. Its better a little bit but map is repeating, so pick a uvw mapping gizmo and move it up.
Maps that have no big contrast in color and shapes you see on them are the best for erupting.
Map that has no visible contrasts in color and shape and can be repeated many times on one surface.
But with this one is going to difficult. See that dark part of the map at the top. Its going to be visible when you repeat it just once. See image on left.
Before we go any further lets see how you make those materials. Open a Material editor. Click on any gray ball. This is going to be a material. On left you see a Standard material setup.
Put a desired map in Diffuse map slot, and a matching black and white map in Bump map slot. Sometimes you can use a bump map as a Specular map too. Now is up to you to set those other parameters to get the result you want. Ant every material is different and unique.
Second thing I done was to make a brick material and apply it to middle part of front facade. What I saw was a big size bricks on front and side walls. Its time to adjust that map. After experimenting a little bit I got satisfying results with U Tile=4.5 and V Tile=8.0 ( see image below)
Tiling adjustments can be done in Material editor for every map separately or in UVW Mapping modifier.
I prefer for this scene to make a material and to adjust tiling for every object separately in UVW map modifier. If this does not help try to select a mapping gizmo and scale it or move it to get satisfying results.
If you have a map that is 982x618 pixels, and you are going to apply it to 400x400 units object, Max is going to squeeze that map in to the object boundaries and map will be unnaturally scaled. So UVW Mapping modifier will help you to get that map look natural and in best size.
This is that UVW Mapping modifier. Starting from the top, see that gizmo is active and you can work with transforming it. Mainly I use box mapping. And at the end is Tiling adjustments.
Next, to apply brick material to this box object that represent support for entrance roof. Now we have to adjust that material so the bricks must be the same size as those on the wall.
This is done. See how the bricks are the same size on both object (wall and box).
There are two same box objects in scene. We are not going to do again same adjustments on that other box. But yes he has to look almost the same.
What we are going to do is open Edit Modifier Stack and copy UVW Mapping modifier from first box and paste it to second box Modifier Stack. So the work is done faster and easier.
Lets see the whole picture. You can see how that brick map is repeating on that front wall. Lets hope that with light and shadows we will cover that up.
You can always take front picture of that wall, take it to photoshop and there paint a brick map and get rid of repeating parts. But we are not going to do that this time.
Brick material is applied to some other objects and every object mapping coordinates are being adjusted separately.
This is a result.
For ground I use a Multy/Sub-Object that has grass and stone materials. Difference is that this time I used box mapping for faces that will be stone and planar mapping for faces that will be grass.
UV Tile is for grass material. It repeats, but you can not see that write away.
To see what have we done so far.
To apply stone material on side walk.

This house should to be red with gray architectural elements. But during the texturing process I made some changes and process can be seen below

This house should to be red with gray architectural elements. But during the texturing process I made some changes and process can be seen below
And this is it. Final render.
These are some of the materials used.

Here you can see all maps used in this texturing process.
This is screen just before render button was clicked.
In scene there is only one omni light and sky light.
Now Rendering....

Wednesday, 14 May 2014

Car Paint Material in 3D Max

You can use it for any product design, especially for mobile phones, mp3 players, bikes....or simply for a concept car. There are many different types of car paints. The most trendy one is the metalized car paint with two specular highlights. (This tutorial will not teach the metalized car paint with the random aluminum flakes, and in order to have this kind of particles you must use Max 9 materials which are explained in other tutorials).
The two specular highlights will give an optimal light reflection to your object in order to show in a very soft and for the human eye pleasureful way the shapes of you objects.

To create two specular highlights you must change the BLINN shader to MULTY-LAYER. This allows you to have 2 independent specular highlights (in Multy-Layer they are called First Specular Layer and Second Specular Layer). One must be very soft the other very hard/strong.

Go to the first specular highlight slot (it is called specular layer) and adjust it until you have a large shape (glossiness) which is not too bright (level). Then do the opposite with the second specular layer: small shape and very bright. After this step go to Maps and add to the reflection map Raytrace. Set the reflection amount to more or less 20
To have more control of the specular highlights in the rendering you can use in your scene a SPECIAL "MR.Area Omni" light (normaly it is better to use MR.Area Omni if you use Mental Ray to make your rendering, but in this case you can use also a normal Omni light). After you have placed the light in the correct location make a right mouse button click on the MR Area Omni and disable "AFFECT DIFFUSE"
After this step this MR.Area Omni will create only specular highlights on the materials. We will use that MR.Area Omni only to create this specular effects that normally is visible on metalized car paint. In this way we have much more control of the position, color and brightness of the specular highlights. Disable the shadows in the MR.Area Omni.

This technique is very helpful if you need a higher number of specular highlights than the existing light sources (that you must create for normal illumination) are already creating on the car paint material.

It is also possible to create a specular color which is different than white. With changing the specular color you can simulate the classical car paints that you can see in the car-tuning environment where often we have a mix of two different colors (diffuse color + specular color). This makes the material more interesting. Here below you have a sample of a mix of more colors. In this case we have a red diffuse color, a blue first specular layer color and a white second specular layer color.
Here below we have exactly the same scene, but without the EXTRA omni lights. The difference is strongly visible. In this sample you can understand how important it can be to use the technique described in this tutorial

Tip 1: If you go to use many Mr Omnies for an object because you want to create many different specular highlights, you will risk to create a less visible shadow of an object. In this case it is necessary to use Ambient/Occlusion to avoid this problem.
Tip 2: If you have other objects in the scene that have normal materials and have NOT to be affected by the Omnies, remember to exclude them from the Omnies with the exclude button from the modify panel.

 I hope you have enjoyed this tutorial.

Wednesday, 2 April 2014

How to create reset button in html

How to change placeholder color with css

::-webkit-input-placeholder { /* WebKit browsers */
    color:    #333;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color:    #333;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
    color:    #333;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
    color:    #333;
}

Wednesday, 26 March 2014

Div centering: when width auto

.outermost-div{
    overflow:hidden;  
}


.inner-div{
   float:left;
    left:50%;
    position: relative;
}

.centered-div{
    position: relative;
    float:left;
    left: -50% ;
    width: auto;
}

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: