Simple 3D Enviroment with Materials

From RMIT Visual Effects
Jump to: navigation, search

Two simple 3D scenes, one with lighting, one without.

3D Scene with Sphere

Check out the scene below. The Sphere (one of Nuke's 3D primitives) is being textured by a Grid. The Shuffle node is only there to add a solid white to the alpha. If it was not there the Sphere becomes semi-transparent. However, the result is 'flat' with no sense of volume to the Sphere.

In the example scene below, the following key nodes have been used:

  • Sphere: One of Nuke's basic geometric primitives. See the page Sphere
  • ScanlineRender: This converts 3D info to 2d. See the page ScanlineRender
  • Camera: This provides the viewpoint to the 3D environment. See the page Camera.
  • Grid: This generates a grid pattern in 2D. Piped into the Sphere, it provides texture information.

There is no light in the scene, so the color comes entirely from the grid.

A simple 3D scene, with no lighting effect.


Press 'Expand' and select and copy everything below this line, then paste into the Nuke node graph.

set cut_paste_input [stack 0]
version 6.3 v2
Camera2 {
 inputs 0
 translate {0 0 7.53000021}
 name Camera1
 selected true
 xpos -313
 ypos -388
}
push $cut_paste_input
Grid {
 output rgb
 number 30
 size 16.5
 name Grid1
 selected true
 xpos -166
 ypos -672
}
Shuffle {
 alpha white
 name Shuffle1
 selected true
 xpos -166
 ypos -648
}
Sphere {
 name Sphere1
 selected true
 xpos -166
 ypos -573
}
Scene {
 name Scene1
 selected true
 xpos -156
 ypos -513
}
push 0
ScanlineRender {
 inputs 3
 output_motion_vectors_type accurate
 name ScanlineRender1
 selected true
 xpos -166
 ypos -367
}

3D Scene with sphere, material and light

In the example below, in addition to the nodes used in the previous scene, the following key nodes have been added:

Instead of being piped directly into the sphere, the textures have been applied via an ApplyMaterial (which prepares the Sphere for a material) and a BasicMaterial (which specifies the specific properties of the material).

A light has also been added. In order for it to have an effect upon the texture, it must share space with the Sphere. This is done using a Scene node.

The diffuse and specular properties of a sphere applied through a BasicMaterial and an ApplyMaterial node.

Press 'Expand' and select and copy everything below this line, then paste into the Nuke node graph.

set cut_paste_input [stack 0]
version 9.0 v7
BackdropNode {
 inputs 0
 name "BLUE BOUNCED LIGHT"
 tile_color 0x87854701
 gl_color 0x87854701
 label "BLUE BOUNCED LIGHT"
 note_font "Arial Black"
 note_font_size 20
 selected true
 xpos -996
 ypos -1004
 bdwidth 244
 bdheight 166
}
BackdropNode {
 inputs 0
 name "DIFFUSE MAP"
 tile_color 0x87854701
 gl_color 0x87854701
 label "DIFFUSE MAP"
 note_font "Arial Black"
 note_font_size 20
 selected true
 xpos -869
 ypos -1365
 bdwidth 200
 bdheight 170
}
BackdropNode {
 inputs 0
 name MAIN_LIGHT
 tile_color 0x87854701
 gl_color 0x87854701
 label "MAIN LIGHT"
 note_font "Arial Black"
 note_font_size 20
 selected true
 xpos -558
 ypos -1015
 bdwidth 206
 bdheight 185
}
BackdropNode {
 inputs 0
 name "SPECULAR MAP"
 tile_color 0x87854701
 gl_color 0x87854701
 label "SPECULAR MAP"
 note_font "Arial Black"
 note_font_size 20
 selected true
 xpos -1139
 ypos -1236
 bdwidth 200
 bdheight 150
}
Camera2 {
 inputs 0
 translate {0 0 15}
 pivot {0 0 -15}
 name Camera7
 selected true
 xpos -765
 ypos -808
}
Light2 {
 inputs 0
 color {0.178416 0.334345 0.747239}
 color_panelDropped true
 intensity 2.1
 translate {-1.440000057 -1.230000019 -0.27999997}
 depthmap_slope_bias 0.01
 name Light1
 selected true
 xpos -976
 ypos -924
}
Light2 {
 inputs 0
 intensity 2.1
 translate {2.430000067 1.409999967 3}
 depthmap_slope_bias 0.01
 name Light5
 selected true
 xpos -540
 ypos -924
}
Grid {
 inputs 0
 size 33
 name Grid3
 selected true
 xpos -1088
 ypos -1166
}
Grade {
 channels rgba
 black 0.17
 name Grade2
 selected true
 xpos -1088
 ypos -1139
}
push 0
Grid {
 inputs 0
 size 45
 color {0.455 0.138432 0 0.455}
 color_panelDropped true
 name Grid5
 selected true
 xpos -849
 ypos -1285
}
push 0
BasicMaterial {
 inputs 4
 diffuse 0.36
 specular 0.48
 min_shininess 19
 max_shininess 3.05
 name BasicMaterial2
 selected true
 xpos -849
 ypos -1139
}
push $cut_paste_input
Sphere {
 selectable false
 name Sphere4
 selected true
 xpos -655
 ypos -1163
}
ApplyMaterial {
 inputs 2
 name ApplyMaterial2
 selected true
 xpos -655
 ypos -1139
}
Scene {
 inputs 3
 name Scene5
 selected true
 xpos -645
 ypos -924
}
push 0
ScanlineRender {
 inputs 3
 conservative_shader_sampling false
 motion_vectors_type distance
 name ScanlineRender7
 selected true
 xpos -655
 ypos -787
}
Write {
 name Write6
 selected true
 xpos -655
 ypos -722
}