下記のように設定を変更した。kdを大きくし、GUIのログを見てradiusを変更した。
photons {
caustics 10000000 kd 10000 0.5
}
- -
- -
日々3DCGの世界は進歩しているけど、勉強して理解したことをまとめていきたい。RenderMan互換レンダラーやグローバル・イルミネーション。いろんなことに好奇心を持ち面白くなってくる。目指せShader書き!!
1/1
image {
resolution 640 480
aa 1 1
samples 4
filter gaussian
}
gi {
type ambocc
bright { "sRGB nonlinear" 0.8 0.8 0.8 }
dark { "sRGB nonlinear" 0 0 0 }
samples 32
maxdist 3.0
}
%%shader
shader {
name "Yellow"
type diffuse
diff 1 1 0
}
shader {
name "Xaxis"
type diffuse
diff 1 0 0
}
shader {
name "Yaxis"
type diffuse
diff 0 1 0
}
shader {
name "Zaxis"
type diffuse
diff 0 0 1
}
shader {
name floor
type diffuse
diff 0.9 0.9 0.9
}
shader {
name XZ
type diffuse
diff 0.2 0.4 0.6
}
modifier {
name perlinName
type perlin
function 1
size 1
scale 3.5
}
%% camera
camera {
type pinhole
eye 3 -20 5
target 0 0 0
up 0 0 1
fov 25
aspect 1.3333
}
%% light sources
/*
light {
type sunsky
up 0 0 1
east 0 1 0
sundir -3 -10 10
turbidity 6
samples 128
}
*/
light {
type point
color { "sRGB nonlinear" 1.000 1.000 1.000 }
power 1500.0
p -3 -10 10
}
%% geometry
object {
shader floor
type plane
p 0 0 -3
n 0 0 1
}
object {
shader XZ
type plane
p 0 6 0
n 0 1 0
}
object {
shader "Yellow"
modifier perlinName
type sphere
name "sp1"
c 0 0 0
r 1.2
}
instance {
name nameOfInstance
geometry "sp1"
transform {
rotatex 0
scaleu 1.0
translate 2.5 0 0
}
shader floor
modifier perlinName
}
object {
shader "Xaxis"
transform {
rotatex 0
scaleu 0.2
scale 1 1 30
rotatey 90
translate 0 0 0
}
type cylinder
name Xjiku
}
object {
shader "Yaxis"
transform {
rotatex 90
scaleu 0.2
scale 1 50 1
rotatey 90
translate 0 0 0
}
type cylinder
name Yjiku
}
object {
shader "Zaxis"
transform {
scaleu 0.2
scale 1 1 30
translate 0 0 0
}
type cylinder
name Zjiku
}
image {
resolution 640 480
aa 1 1
samples 4
filter gaussian
}
%%shader
shader {
name "Yellow"
type diffuse
diff 1 1 0
}
shader {
name "shader09"
type glass
eta 1.4
color 1 1 1
}
shader {
name "shader08"
type glass
eta 2.4
color 1 1 1
}
shader {
name "Xaxis"
type diffuse
diff 1 0 0
}
shader {
name "Yaxis"
type diffuse
diff 0 1 0
}
shader {
name "Zaxis"
type diffuse
diff 0 0 1
}
shader {
name floor
type diffuse
texture "check_red10.jpg"
}
shader {
name XZ
type diffuse
texture "check_b10.jpg"
}
modifier {
name perlinName
type perlin
function 1
size 1
scale 3.5
}
%% camera
camera {
type pinhole
eye 3 -20 5
target 0 0 0
up 0 0 1
fov 25
aspect 1.3333
}
%% light sources
light {
type point
color { "sRGB nonlinear" 1.000 1.000 1.000 }
power 1500.0
p -3 -10 10
}
light {
type ibl
image galileo_probe.hdr
center 0 -1 0
up 0 0 1
lock true
samples 200
}
%% geometry
object {
shader "shader09"
/* modifier perlinName */
type sphere
name "sp1"
c 0 0 0
r 1.4
}
instance {
name nameOfInstance0
geometry "sp1"
transform {
rotatex 0
scaleu 1.0
translate 2.5 0 0
}
shader "shader08"
}
object {
shader "Xaxis"
transform {
rotatex 0
scaleu 0.2
scale 1 1 30
rotatey 90
translate 0 0 0
}
type cylinder
name Xjiku
}
object {
shader "Yaxis"
transform {
rotatex 90
scaleu 0.2
scale 1 50 1
rotatey 90
translate 0 0 0
}
type cylinder
name Yjiku
}
object {
shader "Zaxis"
transform {
scaleu 0.2
scale 1 1 30
translate 0 0 0
}
type cylinder
name Zjiku
}
object {
shader "floor"
transform {
translate 0 0 -1.5
}
type generic-mesh
name "floormesh"
points 4
-10.0 -10.0 0
10.0 -10.0 0
-10.0 10.0 0
10.0 10.0 0
triangles 2
1 3 2 1 2 0
normals vertex
0.0 0.0 1.0
0.0 0.0 1.0
0.0 0.0 1.0
0.0 0.0 1.0
uvs facevarying
1.0 0.0
1.0 1.0
0.0 1.0
1.0 0.0
0.0 1.0
0.0 0.0
}
instance {
name nameOfInstance
geometry "floormesh"
transform {
rotatex 90
scaleu 1.0
translate 0 3 0
}
shader XZ
}
image {
resolution 640 480
aa 1 1
samples 4
filter gaussian
}
gi {
type ambocc
bright { "sRGB nonlinear" 0.8 0.8 0.8 }
dark { "sRGB nonlinear" 0 0 0 }
samples 32
maxdist 3.0
}
%%shader
shader {
name "Yellow"
type diffuse
diff 1 1 0
}
shader {
name "Magenta"
type diffuse
diff 1 0 1
}
shader {
name sfshi.shader
type shiny
diff { "sRGB nonlinear" 0.800 0.800 0.800 }
refl 0.5
}
shader {
name floor
type diffuse
diff 0.9 0.9 0.9
}
%% camera
camera {
type pinhole
eye 3 -20 5
target 0 0 0
up 0 0 1
fov 25
aspect 1.3333
}
%% light sources
light {
type point
color { "sRGB nonlinear" 1.000 1.000 1.000 }
power 1500.0
p -3 -10 10
}
%% geometry
object {
shader floor
type plane
p 0 0 -1.75
n 0 0 1
}
object {
shader "Yellow"
type sphere
name sp1
c -1 0 0
r 1.75
}
object {
shader "Magenta"
type sphere
name sp2
c 1 0 0
r 1.75
}
instance {
name nameOfInstance
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate -1.75 -4 -0.5
}
shader sfshi.shader
}
instance {
name nameOfInstance2
geometry sp2
transform {
rotatex 0
scaleu 1.0
translate -0.75 -4 -0.5
}
shader sfshi.shader
}
image {
resolution 640 480
aa 1 1
samples 4
filter gaussian
}
gi {
type ambocc
bright { "sRGB nonlinear" 0.8 0.8 0.8 }
dark { "sRGB nonlinear" 0 0 0 }
samples 32
maxdist 3.0
}
%%shader
shader {
name "Yellow"
type diffuse
diff 1 1 0
}
shader {
name "Magenta"
type diffuse
diff 1 0 1
}
shader {
name sfshi.shader
type shiny
diff { "sRGB nonlinear" 0.800 0.800 0.800 }
refl 0.5
}
shader {
name sfmir.shader
type mirror
refl { "sRGB nonlinear" 0.800 0.800 0.800 }
}
shader {
name floor
type diffuse
diff 0.9 0.9 0.9
}
%% camera
camera {
type pinhole
eye 3 -20 5
target 0 0 0
up 0 0 1
fov 25
aspect 1.3333
}
%% light sources
light {
type point
color { "sRGB nonlinear" 1.000 1.000 1.000 }
power 1500.0
p -3 -10 10
}
light {
type ibl
image hdr017.hdr
center 0 -1 0
up 0 0 1
lock true
samples 200
}
%% geometry
object {
shader floor
type plane
p 0 0 -1.0
n 0 0 1
}
object {
shader "Yellow"
type sphere
name sp1
c 0 0 0
r 1.0
}
instance {
name nameOfInstance
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate -2 0 0
}
shader sfshi.shader
}
instance {
name nameOfInstance2
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate -4 0 0
}
shader sfshi.shader
}
instance {
name nameOfInstance3
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate 2 0 0
}
shader sfshi.shader
}
instance {
name nameOfInstance4
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate 4 0 0
}
shader sfshi.shader
}
instance {
name nameOfInstance5
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate -2 8 0
}
shader sfmir.shader
}
instance {
name nameOfInstance6
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate -4 8 0
}
shader sfmir.shader
}
instance {
name nameOfInstance7
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate 2 8 0
}
shader sfmir.shader
}
instance {
name nameOfInstance8
geometry sp1
transform {
rotatex 0
scaleu 1.0
translate 4 8 0
}
shader sfmir.shader
}
import joons.*;
JoonsRenderer jr;
boolean rendered = false;
float eyeX = 50;
float eyeY = 90;
float eyeZ = 50;
float centerX = 0;
float centerY = 0;
float centerZ = 0;
float upX = 0;
float upY = 0;
float upZ = -1;
float fov = PI / 4;
float aspect = (float) 1.3333;
float zNear = 5;
float zFar = 10000;
public void setup() {
size(640, 480, P3D);
jr = new JoonsRenderer(this,width,height);
jr.addAfterShader("shader {");
jr.addAfterShader(" name Green");
jr.addAfterShader(" type shiny");
jr.addAfterShader(" diff 0.25 0.8 0.25");
jr.addAfterShader(" refl 0.25");
jr.addAfterShader("}");
jr.addAfterShader("shader {");
jr.addAfterShader(" name blueshiny");
jr.addAfterShader(" type shiny");
jr.addAfterShader(" diff 0.2 0.4 0.75");
jr.addAfterShader(" refl 0.25");
jr.addAfterShader("}");
}
public void draw() {
background(128);
lights();
fill(255);
beginRecord("joons.OBJWriter","");//leave the second parameter as "".
perspective(fov, aspect, zNear, zFar);//use perspective() before camera()!!
camera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
rect(-500,-500,1000,1000);//the floor plane
noSmooth(); //In my library, noSmooth() is used to separate one object from another.
translate(0,-20,20);
rotateX((float) 0.3);
rotateY((float) 0.2);
rotateZ((float) 0.1);
translate(10,0);
sphere(10);
translate(10,0);
sphere(10);
translate(10,0);
sphere(10);
translate(10,0);
sphere(10);
translate(-40,30);
rotateZ((float)1.5);
rotateX((float) 0.8);
box(20);
endRecord();
if(rendered)
jr.display();
}
public void keyPressed() {
if (key == 'r' || key == 'R' && !rendered) {
saveFrame("capture.png");
jr.setShader("sphere0","Green");
jr.setShader("sphere1","blueshiny");
jr.setShader("sphere2","Green");
jr.setShader("sphere3","blueshiny");
jr.setShader("object1","Red");
jr.setSC("ambient.sc");
rendered=jr.render("bucket");
}
}
1/1