Home CGenie Tutorials

CGenie Tutorials



daz3d-shader_mixer

In the first in a series, guest tutorial author Caroline Begbie introduces some of the powerful new features of DAZ3d's Shader Mixer. She does a great job of demonstrating how the shader mixer can be used to create more advanced maps and materials inside the software.


Find out more about the latest version and download for free on the DAZ3d website.


 
Quick Post

Enter code here  

Discuss this item on the forums. (0 posts)

Rendering armour texture in Max

This tutorial will take you through the process of making a realistic metal armour texture that looks great and is transferrable to any scene. Normally you'd be using the reflection of the scene itself to generate the metallic look to armour, however as many of you will know, you don't often have the time or the need to create a whole scene just to act as a reflection.  So this tutorial is designed to show a really, really quick way of getting a realistic metal armour in a matter of minutes...

What you need

To demonstrate this I have used a set of maps from Medieval Textures (armor004):

Armor texture preview

However if you don't have the collection, you can use any others you've produced.

Getting started

Create a new material and set it up with the following settings:

  • Diffuse color: R:39, G:39, B:39
  • Specular Level: 60
  • Glossiness: 25

In the map slots put the relevant maps (eg color in the color slot, bump in the bump etc) and set the following levels:

  • Bump: 150
  • Displacement: 10
  • Reflection: 90

(you may need to tweak these to suit your particular scene)

Adding reflection

Raytrace backgroundNow to add the metallic reflection to our armour texture we need to add a reflection, so click on the reflection map slot and choose 'raytrace'.  Under Background, click the map slot and add an environment map (any hdr image or sky texture you have).  It's important to play around at this point and try out different maps as this has a huge effect on your finished image.

Rendering your armour texture

That's pretty much it. Just create your scene, it can be as simple as you like - I've created a sphere and added two lights and hit render and got this:

Finished armour texture

 

 
Quick Post

Enter code here  

Discuss this item on the forums. (0 posts)

Glowing materials
In the above render you can see two identical spheres, both have exactly the same texture applied. However you'll see that the one on the right is exuding light and is much more realistic in the way it casts light on it's surroundings. This tutorial will highlight a few useful settings for you to use in making your materials cast light.

The setup

Set upFirst you should set up your scene as you require - you can do whatever you want. I've slapped a sand texture and a charcoal texture from here onto a plane and applied the respective displacement, bump and speculars to add some realism.

Add a light source and set it at a very low level (eg 0.3). This is important as it will turn off the default lighting in 3d studio max (once you've finished testing, you may want to turn off the light completely if the light source isn't required).

The Glow material

material1

Next apply a new material to the object you want to emit light and change the map type from Standard to Arch & Design (mi).

Click the M button next to the color picker and add your texture (you can generally set your texture up with all the bumps, specular settings etc).

If you scroll down, you'll see a section called Self Illumination (Glow). Tick the box next to Self Illumination (Glow) to turn it on and pick the color.

 

material2As my charcoal texture was variable in the light it gave off (ie the black bits should not give off light, whereas the orange bits should) I added the color map here as a filter by clicking the M button next to the color picker.

Also increase the physical units to about 1000 (you may need to play with this to suit your scene) & tick both 'visible in Reflections' and 'Illuminates the Scene (when using FG)'.

 

 

 

 

 

Final tips

final_gather

That's actually moreorless it! If you're using an older version of max, make sure you have final gather enabled in your mental ray settings (and of course make sure you have mental ray as the renderer).

You might also want to play with the final gather multiplier to get a stronger effect.

However that should be enough to get you adding a little glow to your scenes!

 

 

Final glow

 

 

 
Quick Post

Enter code here  

Discuss this item on the forums. (0 posts)

 

Quick introduction to shadow maps
Shadow maps are a dead easy way to add lots of depth and interest to your scenes with the minimum of effort. They help to create the illusion of complexity that is often missing from textured surfaces.

In this tutorial we're going to demonstrate just how simple shadow maps are to use - by the end of it, you should have a useful tool in your palette to use to add life to your scenes.

What you need

  • 3d graphics program - this have been done in 3d Studio Max, but pretty much anything will do
  • 1 surfaced texture -we've used a cobbled texture with bump, specular and displacement maps from the Medieval textures DVD.
  • 1 shadow map - again here we've used a shadow map from the same DVD.

The set up

It's a super-simple setup, just a flat plane for the ground surface and a directional light (set to cast ray-traced shadows).

Once you've done this you should have a scene similar to below.

Without shadow map

Now this looks nice as a texture, but I think you'll agree that it looks a little lifeless?

Adding the shadow map

simple_light_setup

In real life, light rarely just hits the ground evenly over large areas, instead there are trees, pylons, clouds, buildings etc etc that cast a multitude of shadows. Now, there's nothing stopping you modelling all these objects and your scene will look great, however that's a fairly time consuming process for objects that won't even be visible, and it's also going to grind your renderer to a halt!

So this is where shadow maps come in - they are a grayscale map used to simulate the shadows cast by complex objects.

So between the ground plance and the light source, should put another plane, this will hold your shadow map.

The shadow map will be a grayscaled image where the black areas will be treated as transparent and the white areas as opaque.

In short, if the light hits a white area it's stopped, if it hits a black area it's allowed through.

map_slot

Now in your material editor create a material and place a shadow map in the opacity slot.

Then apply to the shadow plane and we're done.

Final render

If you now hit render, you should see a much more realistic scene rendered - the shadow map is being used to cast shadows across the surface creating a much more realistic impression.

Finished Shadow Map

 

 

 
Quick Post

Enter code here  

Discuss this item on the forums. (0 posts)

Introduction

 

We're going to step it up a level in this tutorial
This one should take about 10 mins to complete.

We will be covering four main areas.

  1. Variables and data types
  2. Loops
  3. Comparison Operators
  4. If statements

 

Variables

You can think of variables in MXS (maxscript) as a temporary named storage place for an "object" of some sort. think of them like lockers at the swimming pool. there are a huge number of them available (unlimited) and they all have nothing in them and are unnamed. Once you put something in a locker (variable) - it might be a number, a piece of text or even a modifier - and give it a name it will always be in there until you replace it with something else.

To set a variable in maxscript you simply type the following:

variableName = variableValue

The variable name can be anything you like and the value can be almost anything as well. For now we will use a float which is a number with a decimal place

ourVariable = 34.5

if you enter that into the listener and execute it, it will return 34.5
now if you type an expression such as:

2 * ourVariable

Maxscript will return 69.0

The main data types in maxscript are the following:

Float - these are numbers will a decimal component to them ie 234.643
Integer - These numbers are whole numbers only ie 5 or 200
Boolean - true or false
String - this is a piece of text. To set a string you need to enclose it in quote marks ie:

myStringVariable = "Maxscript sure is handy"

One last thing. You can convert different data types from one to another like this:

"35" as integer

the 35 is a string (because it has quote marks around it) but the "as integer" after it, turns it into an integer. Obviously "as string" and "as float" do as you would expect.

Loops

Loops are where maxscript becomes really powerful and useful. They enable maxscript to do repetitive tasks rather than you and the mouse.

Imagine you have built a scene with many objects. You have added a turbosmooth modifier to all the objects with an iteration value of 2. This is now causing you problems because the scene is too slow to navigate and you wish you had set the iterations to 1 with a rendertime setting of 2.

Here is the code:

for obj in $ do
(
obj.modifiers[#turbosmooth].iterations = 1
obj.modifiers[#turbosmooth].useRenderIterations = true
obj.modifiers[#turbosmooth].renderIterations = 2
)


We will now look at it line by line.

for obj in $ do - Our for loop is saying in plain English: "For the objects in our current selection, do the commands inside the following brackets."

( - We open the brackets
obj.modifiers[#turbosmooth].iterations = 1 - we set the iterations to 1

obj.modifiers[#turbosmooth].useRenderIterations = true
obj.modifiers[#turbosmooth].renderIterations = 2 - these lines should be obvious to you by now.

) - We close the brackets to end the for loop.

Max will keep looping through the code on every object in the selection until it has done them all.

You can test the code by making a bunch of objects all with turbosmooth on them. THEY MUST ALL HAVE A TURBOSMOOTH MODIFIER. if one object doesn't have a turbosmooth modifier, when MXS tries to talk to it, it won't find it and your script will fail with an error. This obviously isn't very satisfactory.

Comparison operators

We can solve this problem by adding an "If" statement to the code

But first of all we'll look at some comparison operators. if we have two items such as the numbers 5 and 2, we can compare them in different ways try typing the following into the listener:

5 == 2
-Is 5 equal to 2? -This returns False

5 != 2
-Is 5 NOT equal to 2? -This returns True

5 < 2
-Is 5 less than 2 -This returns False

5 > 2
-Is 5 greater than 2 -This returns True

There are more as well which you'll find useful in due course.

If Statements

The way if works is like this:

if (expression resulting in true or false) do
(
code goes here
)

Here is a sample which you should be able to read easily by now:

if (obj.modifiers[#turbosmooth] != undefined) do
(
obj.modifiers[#turbosmooth].iterations = 1
obj.modifiers[#turbosmooth].useRenderIterations = true
obj.modifiers[#turbosmooth].renderIterations = 2
)

That will check an object to make sure it has a turbosmooth modifier and then if it does, run through the code in the following brackets

Conclusion

Now when we put it all together, we get the following script:

for obj in $ do
(
if (obj.modifiers[#turbosmooth] != undefined) do
(
obj.modifiers[#turbosmooth].iterations = 1
obj.modifiers[#turbosmooth].useRenderIterations = true
obj.modifiers[#turbosmooth].renderIterations = 2
)
)

It should happily run through every object in your current selection and if it has a turbosmooth modifier, set it to the values we specified.

 
Quick Post

Enter code here  

Discuss this item on the forums. (0 posts)
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »
Page 1 of 2