type pbr;
base_color 0.550000 0.570000 0.570000 1.00000;
metalness 1.00000;
- roughness 0.0500000;
+ roughness 0.200000;
emission 0.00000 0.00000 0.00000;
};
- receive_shadows true;
+ shader "sphere.shader";
};
pass "shadow"
{
- shader "_occluder.glsl.shader";
+ shader "sphere_shadow.glsl.shader";
};
-import phong;
-
-uniform Morph
-{
- float morph;
-};
-
-const float PI = 3.1415926535;
-const float OFFSET = 0.001;
-
-#pragma MSP stage(vertex)
-vec3 deform(vec3 p)
-{
- vec3 d = cos(p*(2.0*PI)+morph)*0.05;
- return p*(1.0+(d.x+d.y+d.z)*sin(morph*0.2));
-}
-
-vec4 get_vertex_position() override
-{
- return vec4(deform(vertex.xyz), 1.0);
-}
-
-vec3 get_vertex_normal() override
-{
- vec3 tangent;
- if(abs(normal.x)>abs(normal.y))
- tangent = normalize(vec3(-normal.z, 0.0, normal.x));
- else
- tangent = normalize(vec3(0.0, -normal.z, normal.y));
- vec3 binormal = cross(normal, tangent);
-
- vec3 xn = deform(vertex.xyz-tangent*OFFSET);
- vec3 xp = deform(vertex.xyz+tangent*OFFSET);
- vec3 yn = deform(vertex.xyz-binormal*OFFSET);
- vec3 yp = deform(vertex.xyz+binormal*OFFSET);
-
- return normalize(cross(xp-xn, yp-yn));
-}
+import cooktorrance;
+import sphere_morph;
module "sphere.glsl"
{
- specialize "use_specular" true;
- specialize "use_reflectivity" true;
+ specialize "use_image_based_lighting" true;
};
--- /dev/null
+uniform Morph
+{
+ float morph;
+};
+
+const float PI = 3.1415926535;
+const float OFFSET = 0.001;
+
+#pragma MSP stage(vertex)
+vec3 deform(vec3 p)
+{
+ vec3 d = cos(p*(2.0*PI)+morph)*0.05;
+ return p*(1.0+(d.x+d.y+d.z)*sin(morph*0.2));
+}
+
+vec4 get_vertex_position() override
+{
+ return vec4(deform(vertex.xyz), 1.0);
+}
+
+vec3 get_vertex_normal() override
+{
+ vec3 tangent;
+ if(abs(normal.x)>abs(normal.y))
+ tangent = normalize(vec3(-normal.z, 0.0, normal.x));
+ else
+ tangent = normalize(vec3(0.0, -normal.z, normal.y));
+ vec3 binormal = cross(normal, tangent);
+
+ vec3 xn = deform(vertex.xyz-tangent*OFFSET);
+ vec3 xp = deform(vertex.xyz+tangent*OFFSET);
+ vec3 yn = deform(vertex.xyz-binormal*OFFSET);
+ vec3 yp = deform(vertex.xyz+binormal*OFFSET);
+
+ return normalize(cross(xp-xn, yp-yn));
+}
+++ /dev/null
-mesh "Sphere.mesh";
-technique "sphere_phong.tech";
+++ /dev/null
-pass ""
-{
- material
- {
- type basic;
- diffuse 0.0 0.0 0.0;
- specular 0.77 0.78 0.78;
- reflectivity 0.77;
- };
- shader "sphere.shader";
-};
-pass "shadow"
-{
- //shader "_occluder.glsl.shader";
- shader "sphere.shader";
-};
--- /dev/null
+import common;
+import sphere_morph;
+
+#pragma MSP stage(fragment)
+void main()
+{
+ frag_color = vec4(1.0);
+}
keyboard(window),
view(window, gl_ctx),
camera(resources.get<GL::Camera>("Camera.camera")),
- sphere(resources.get<GL::Object>("sphere_phong.object")),
+ sphere(resources.get<GL::Object>("Sphere.object")),
sphere_morph(0.0f),
sphere_frozen(false),
sphere_stopped(false),
step->set_lighting(&resources.get<GL::Lighting>("Desert.lightn"));
step->set_depth_test(&GL::DepthTest::lequal());
- env_map = make_unique<GL::EnvironmentMap>(256, GL::RGB16F, sphere, *env_seq);
+ env_map = make_unique<GL::EnvironmentMap>(256, GL::RGB16F, 7, sphere, *env_seq);
sphere.set_matrix(GL::Matrix::translation(GL::Vector3(0.0f, 0.0f, 3.3f)));
content.add(resources.get<GL::Scene>("Background.scene"));