Tutorial
1 - Basic Scene
|
|
In this tutorial we will start from scratch to
create a basic scene complete with four objects, one camera, and two lights.
Then we will create a simple texture and use existing shaders to create
materials for these objects. Eventually we will assign these materials to the
objects and render the complete scene. This tutorial also covers basic scene
setup, basic operations, and introduces fundamental "4D Blue"
tools. |
|
Step 1 - Creating new camera.
|
|
|
Start with new empty scene. In the top menu
select "Create" and then "Cameras" and then
"Camera". A new camera will be created in the scene.
|
|
In the "Nodes Toolbar", select the
newly created camera and rename it to something more unique like "Main
Camera".
|
|
Select the right bottom view, and bring up
the context menu by pressing right mouse button. In the field "Select
Camera", select the camera that has just been created. Now the view
should represent the camera and what can be seen by it.
|
Step 2 - Creating new object and changing the
view shading mode.
|
|
|
Now we want to create a plane that will be
used as a "floor". We could again use the top menu to create it,
but this time we are going to use the context menu. Again press right mouse
button and select "Polygonal Object" and choose "Plane".
A plane with default parameters will be created.
|
|
Now in the views, you can see the plane. It
is just four lines representing its edges. To make navigation easier later
on, rename it to something more obvious like "Floor".
|
|
A Wireframe
representation is the default shading mode for each view, and sometimes it is
the desired way of viewing the scene. However, for the camera view it is
easier if we can see the scene as it would be rendered. To change the shading
mode for each view, use the context menu on that particular view and select
"Shading" and then choose "Gouraud".
|
|
Now in the camera view we can see the plane
with "gouraud" shading.
|
|
By default the plane is created with edges of
size 1. In this scene we want to change its size to 5 x 5. We could always
scale the object in the "Nodes Toolbar", but it is better to adjust
the objects directly in their constructors when possible. Select the floor
place and switch to "Transformation Toolbar" which is the 2nd
toolbar. You can use the "gliders" which are the cross like boxes
on the right of edit boxes to adjust the values. Just click on them and move
the mouse up and down. The object will change interactively as you move the
mouse. If you know the exact value, you can enter it directly.
|
|
Set the width and depth to 5 and the width
and depth segments to 15. For rendering purposes, one segment would be enough.
But in a shaded view, the plane shading will be more accurate if we use more
segments.
|
Step 3 - Creating new light and changing the
view lighting.
|
|
|
Now we have a camera and a plane in our
scene. The next thing to do is to add some light to it. Using
the context menu, select "Lights" and then "Point Light".
A new point light will be created at <0,0,0>in the scene.
|
|
The light position is clearly not good for
this scene, since we want the light to shine on the plane from above. We need
to move it up, and we are going to do so in the "Nodes Toolbar",
adjusting the light Y position to 5.
|
|
After we adjusted the light position we can
no longer see it in the views. It's time we start adjusting the views
themselves. By pressing the keyboard "Alt" key and using the mouse
buttons and moving the mouse adjust the views to your liking.
|
|
Once we created at least one light, we can
start using the lights in the views. Using the context menu select
"Lighting" and the "Use All".
All active lights will be used to light the scene. The hardware limitations
limit the number of active lights to eight for views, but more can be present
in the scene. In such situations, it is often necessary to use "Use
Selected" option to use the currently selected light to light the scene
to preview the impact of a given light.
|
|
The newly selected light seems very weak as
the scene now seems almost completely dark. It is time to adjust the light
intensity.
|
|
We can adjust the light intensity directly in
the light constructor. Select the light and switch to "Transformations
Toolbar". There you can see many fields controlling the light properties,
but right now we are only interested in the light intensity. Adjust it until
the scene seems bright enough. A value of 10 seems to be pretty good.
|
|
Now we can see our plane again and this time
it is being illuminated by our newly created light.
|
Step 4 - Adding and adjusting cube object.
|
|
|
Now we will add more objects to our simple
scene. We will start with the cube. In the context menu select
"Polygonal Objects" and then select "Cube". Rename the
new object as "Box".
|
|
The new box seems to sink in the floor. That
is because it was created exactly at the scene origin and that means half of
the cube is under the floor. It also seems a bit too big for our purpose.
|
|
We will start by adjusting its size in
"Transformation Toolbar", changing its creating width, height, and
depth to 0.6.
|
|
We could move the object again by adjusting
its position using the "Nodes Toolbar", but this time we are going
to use the move tool. Select the move tool from the top tool shelf.
|
|
Usually objects can be moved in all
directions, but to be precise, we want to limit the tool only to Y axis
first. Move the box 0.3 up.
|
|
Switch to X axis filter and move the box -0.6
to the left.
|
|
The final box position should be (-0.6, 0.3,
0.0).
|
|
Now we want to rotate the box by 30 degrees.
Switch to the "Rotate Tool" and use the Y axis filter. Rotate the
object by 30 degree or until it looks like the image on the left.
|
Step 5 - Adding and adjusting the sphere and
cone objects.
|
|
|
The next object that we are going to add is an uniform sphere. In the context menu, select
"Other" and then "Uniform Sphere". A sphere Wireframe is shown in the views. Most of the
"other" objects are algebraic surfaces of various degrees and it
would be too expensive to create their polygonal representations. Only approximating
Wireframes are created.
|
|
The sphere is clearly too large. We have to
adjust its radius in the constructor (under "Transformations
Toolbar") to 0.3.
|
|
And eventually we have to adjust the sphere
position. Using your favorite method, set the sphere
position to approximately (0.7, 0.3, 0.5).
|
|
Now that the sphere has been added, we can create
the last object - the cone. This time we are going to use NURBS surfaces, but
in this case it doesn't really matter. In the context menu select "NURBS
Objects" and then "Cone".
|
|
The cone seems to be half-way in the floor.
We clearly need to lift it up. It also seems that it is too large.
|
|
First, we are going to adjust its size in its
constructor. Set the radius to 0.3 and the height to 0.6.
|
|
Now we can adjust the cone position. (0.3,
0.6, -0.5) seems to be pretty good fit.
|
|
The object setup is ready and for this scene
we can say the modeling part is done.
|
Step 6 - Shading Process -
Creating Shaders, Textures, and Materials.
|
|
|
Start the "Shaders Editor" using
the button on the left of the views. Alternatively, you can use the
"Window" menu and then select "Shader Editor..."
|
|
In this tutorial, we are not going to create
new shaders as it can be complex and a bit time consuming. Rather we are
going to use existing and already tested shaders that come with "4D
Blue".
|
|
Load the following shaders: SurfaceGI_Diffuse, SurfaceGI_DiffuseTexture,
SurfaceGI_Glass, and SurfaceGI_Mirror.
|
|
Switch to "Texture Editor" tab
dialog.
|
|
Create new texture and name it "Texture
Checker".
|
|
In "Texture Properties" select
"2D Checker". A checker texture with default colors is created. For
our purposes, that is enough.
|
|
Preview the new texture. A checkerboard
should appear in the preview window as well as on the "Texture
Selector".
|
|
Switch to "Material Editor" tab
dialog.
|
|
Create new material using the "New
Material" button. Name the new material "Material Blue". Then
on the left in the "Shader Input Definition" select "SurfaceGI Diffuse" for the Surface Shader. A new
control should appear in the window below.
|
|
Set the diffuse color of this shader by pressing the "Set..." button in Color
- cDiffuse group. A color selection dialog will
appear. Select blue color. It doesn't have to be exactly like the one shown
on the image.
|
|
Now, once the material is setup in the
"Material Quick-Render" we should see a nice blue sphere.
|
|
The material is almost done. The last thing
left to do is to adjust the "Preview Material Appearance". The
color or texture from this section is used in the view previews. It is not
used during rendering. Although it is not necessary to adjust it, it is usually
good practice to make it reflect the overall material appearance. "Pick
Color..." to select a variety of blue. We are done with this material.
|
|
Start new material by pressing "New
Material". Name it "Material Glass". Select "SurfaceGI Glass" as a shader
for this material. Adjust it to make it look like the one on the image.
|
|
Check the "Show background" check
box in the material quick-render. Preview the material. The material is
obviously transparent, but it clearly doesn't look like a glass material. We
still need to adjust its Index of Refraction (IOR).
|
|
In "Material Properties" adjust the
material IOR to 1.45 which is a good value for glass.
|
|
Now the material looks so much better. For
this tutorial it looks good enough.
|
|
Once again we need to adjust the final
material appearance for previews and we are done with this material.
|
|
Start new material and name it "Material
Checker". Select "SurfaceGI DiffTexture" as the material shader.
Then use the texture that we created as a "tImage
Map".
|
|
This time for the quick-render preview we
want to use "floor" like object, since the material will be used on
our "floor".
|
|
And the last thing to do is to setup the
preview section. This time, however, we are going to use texture and we are
going to select the "Texture Checker" that we also use in the shader. In this case, the resolution doesn't matter since
the texture is so simple. But for more complex texture, we would also
probably want to use larger resolution. For now on 64x64 is enough.
|
|
Now we can create the last material. Once
again start new material and name it "Texture Mirror". Select
"SurfaceGI Mirror" as the shader and adjust the "cSpecularColor"
to a slighly blue-green color.
|
|
The material clearly looks like mirror. We
are almost done.
|
|
And the final step. Adjust the color
accordingly.
|
Step 7 - Shading Process -
Assigning Materials to Objects/Surfaces.
|
|
|
We just finished with creating materials for
our scene. The last thing we need to do is to assign them to our objects. To
do so, we are going to use "Material Selector".
|
|
Select the "Material Mirror" by
clicking on it.
|
|
Select the "Sphere" surface.
|
|
Click on "Assign
Material". The mirror material
has just been assigned to our sphere object.
|
|
The box has six surfaces, although we can
assign different materials to each one, we just want to use one material on
all of them. To quickly select all six surfaces select the "Box".
You can always select more then one surface using the "Ctrl" key if
needed. For the other objects, assign the glass material to the cone and the
checker material to the floor.
|
Step 8 - Final Adjustments,
Rendering.
|
|
|
After we assigned all the materials, our
scene should look something like that. It looks pretty good, except the
checker texture seems to be way too big. We are going to adjust that next.
|
|
Select the floor object and in the
"Surface Toolbar" select the "UVW Mapping" Surface Tool.
A new dialog controlling the mapping properties will appear.
|
|
Adjust the UV Scale of this object. A value
of eight seems to be pretty good. You can always preview the final result in
views as you adjust the mapping properties of surfaces.
|
|
Now it looks so much better.
|
|
We already have one light in our scene, but
the image might be too dark in shaded areas. We are now going to add an
ambient light. In the context menu, select "Lights" and then
"Ambient Light". The default ambient light is very bright, and we
need to adjust it.
|
|
In the light constructor, change the light
color.
|
|
A 40% grey should be perfect for our needs.
|
|
Now, our scene is completed. The last thing
is to do is to render it.
|
|
Select "Render Setup" under the
"Rendering" menu.
|
|
Set the Camera to our "Main
Camera". Keep the rest unchanged.
|
|
Render ! - Select "Render" under the
"Rendering" menu. Now the scene will be rendered. Depending on your
computer, it may take few seconds to a minute.
|
|
The image looks pretty good. But it is small,
aliased and the sphere has a blue "sky" reflecting in it. We still
need to make some adjustments then.
|
|
Select "Environment Setup" under
"Rendering" menu.
|
|
Adjust the "Background Color" to something
brighter, close to a white color.
|
|
Select "Render Setup" under the
"Rendering" menu. And in the second tab, change the resolution to
480x360 and enable anti-aliasing. Contrast of 0.2 is usually good enough, and
a value of four for "Max Samples Grid Size" means that we are going
to use 16 samples per pixel.
|
|
Render again and this time you should see an
image like this. You have just finished this tutorial. I hope it gives you enough
skills to start playing with "4D Blue" a bit more.
|