[DEBUG] set systelm work again
This commit is contained in:
parent
151aba4a58
commit
5655d3e12b
@ -2,14 +2,14 @@
|
|||||||
# www.blender.org
|
# www.blender.org
|
||||||
mtllib cube.mtl
|
mtllib cube.mtl
|
||||||
o Cube
|
o Cube
|
||||||
v 0.499999 0.499999 -0.499999
|
v 0.5 0.5 -0.5
|
||||||
v 0.499999 -0.499999 -0.499999
|
v 0.5 -0.5 -0.5
|
||||||
v 0.499999 0.499999 0.499999
|
v 0.5 0.5 0.5
|
||||||
v 0.499999 -0.499999 0.499999
|
v 0.5 -0.5 0.5
|
||||||
v -0.499999 0.499999 -0.499999
|
v -0.5 0.5 -0.5
|
||||||
v -0.499999 -0.499999 -0.499999
|
v -0.5 -0.5 -0.5
|
||||||
v -0.499999 0.499999 0.499999
|
v -0.5 0.5 0.5
|
||||||
v -0.499999 -0.499999 0.499999
|
v -0.5 -0.5 0.5
|
||||||
vt 0.875000 0.500000
|
vt 0.875000 0.500000
|
||||||
vt 0.625000 0.750000
|
vt 0.625000 0.750000
|
||||||
vt 0.625000 0.500000
|
vt 0.625000 0.500000
|
||||||
|
@ -6,8 +6,8 @@ precision mediump int;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Input:
|
// Input:
|
||||||
in vec3 in_position;
|
layout (location = 0) in vec3 in_position;
|
||||||
in vec2 in_textureCoords;
|
layout (location = 1) in vec2 in_textureCoords;
|
||||||
uniform mat4 in_matrixTransformation;
|
uniform mat4 in_matrixTransformation;
|
||||||
uniform mat4 in_matrixProjection;
|
uniform mat4 in_matrixProjection;
|
||||||
uniform mat4 in_matrixView;
|
uniform mat4 in_matrixView;
|
||||||
|
@ -13,9 +13,9 @@ struct Light {
|
|||||||
const int MAX_LIGHT_NUMBER = 8;
|
const int MAX_LIGHT_NUMBER = 8;
|
||||||
|
|
||||||
// Input:
|
// Input:
|
||||||
in vec3 in_position;
|
layout (location = 0) in vec3 in_position;
|
||||||
in vec3 in_normal;
|
layout (location = 1) in vec2 in_textureCoords;
|
||||||
in vec2 in_textureCoords;
|
layout (location = 2) in vec3 in_normal;
|
||||||
// 2 light for suns and other for locals ...
|
// 2 light for suns and other for locals ...
|
||||||
uniform Light in_lights[MAX_LIGHT_NUMBER];
|
uniform Light in_lights[MAX_LIGHT_NUMBER];
|
||||||
|
|
||||||
|
@ -48,6 +48,12 @@ public class LowPolyApplication extends GaleApplication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(final GaleContext context) {
|
public void onCreate(final GaleContext context) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
this.env = new Environement();
|
this.env = new Environement();
|
||||||
setSize(new Vector2f(800, 600));
|
setSize(new Vector2f(800, 600));
|
||||||
setTitle("Low Poly sample");
|
setTitle("Low Poly sample");
|
||||||
@ -60,9 +66,9 @@ public class LowPolyApplication extends GaleApplication {
|
|||||||
|
|
||||||
// add a cube to show where in the light ...
|
// add a cube to show where in the light ...
|
||||||
final Entity localLight = new Entity(this.env);
|
final Entity localLight = new Entity(this.env);
|
||||||
this.lightPosition = new ComponentPosition(new Transform3D(new Vector3f(-10, -10, 0)));
|
this.lightPosition = new ComponentPosition(new Transform3D(new Vector3f(-10, -10, 1)));
|
||||||
localLight.addComponent(this.lightPosition);
|
localLight.addComponent(this.lightPosition);
|
||||||
localLight.addComponent(new ComponentStaticMesh(new Uri("RES", "cube.obj")));
|
localLight.addComponent(new ComponentStaticMesh(new Uri("RES", "cube-one.obj")));
|
||||||
localLight.addComponent(new ComponentTexture(new Uri("RES", "grass.png")));
|
localLight.addComponent(new ComponentTexture(new Uri("RES", "grass.png")));
|
||||||
localLight.addComponent(new ComponentLight(new Light(new Vector3f(0, 2, 0), new Vector3f(0, 0, 0), new Vector3f(0.8f, 0.01f, 0.002f))));
|
localLight.addComponent(new ComponentLight(new Light(new Vector3f(0, 2, 0), new Vector3f(0, 0, 0), new Vector3f(0.8f, 0.01f, 0.002f))));
|
||||||
localLight.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert", "loxelEngine"), new Uri("DATA", "basic.frag", "loxelEngine")));
|
localLight.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert", "loxelEngine"), new Uri("DATA", "basic.frag", "loxelEngine")));
|
||||||
@ -80,7 +86,8 @@ public class LowPolyApplication extends GaleApplication {
|
|||||||
this.materialCube = new Material();
|
this.materialCube = new Material();
|
||||||
basicTree.addComponent(new ComponentMaterial(this.materialCube));
|
basicTree.addComponent(new ComponentMaterial(this.materialCube));
|
||||||
basicTree.addComponent(new ComponentStaticMesh(new Uri("RES", "cube.obj")));
|
basicTree.addComponent(new ComponentStaticMesh(new Uri("RES", "cube.obj")));
|
||||||
basicTree.addComponent(new ComponentTexture(new Uri("RES", "grass.png")));
|
basicTree.addComponent(new ComponentTexture(new Uri("RES", "mud.png")));
|
||||||
|
//basicTree.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert", "loxelEngine"), new Uri("DATA", "basic.frag", "loxelEngine")));
|
||||||
basicTree.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert", "loxelEngine"), new Uri("DATA", "basicMaterial.frag", "loxelEngine"),
|
basicTree.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert", "loxelEngine"), new Uri("DATA", "basicMaterial.frag", "loxelEngine"),
|
||||||
(EngineLight) this.env.getEngine(EngineLight.ENGINE_NAME)));
|
(EngineLight) this.env.getEngine(EngineLight.ENGINE_NAME)));
|
||||||
this.env.addEntity(basicTree);
|
this.env.addEntity(basicTree);
|
||||||
|
@ -6,8 +6,8 @@ precision mediump int;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Input:
|
// Input:
|
||||||
in vec3 in_position;
|
layout (location = 0) in vec3 in_position;
|
||||||
in vec2 in_textureCoords;
|
layout (location = 1) in vec2 in_textureCoords;
|
||||||
uniform mat4 in_matrixTransformation;
|
uniform mat4 in_matrixTransformation;
|
||||||
uniform mat4 in_matrixProjection;
|
uniform mat4 in_matrixProjection;
|
||||||
uniform mat4 in_matrixView;
|
uniform mat4 in_matrixView;
|
@ -13,9 +13,9 @@ struct Light {
|
|||||||
const int MAX_LIGHT_NUMBER = 8;
|
const int MAX_LIGHT_NUMBER = 8;
|
||||||
|
|
||||||
// Input:
|
// Input:
|
||||||
in vec3 in_position;
|
layout (location = 0) in vec3 in_position;
|
||||||
in vec3 in_normal;
|
layout (location = 1) in vec2 in_textureCoords;
|
||||||
in vec2 in_textureCoords;
|
layout (location = 2) in vec3 in_normal;
|
||||||
// 2 light for suns and other for locals ...
|
// 2 light for suns and other for locals ...
|
||||||
uniform Light in_lights[MAX_LIGHT_NUMBER];
|
uniform Light in_lights[MAX_LIGHT_NUMBER];
|
||||||
|
|
@ -104,8 +104,8 @@ public class ComponentRenderTexturedMaterialsStaticMesh extends ComponentRender
|
|||||||
this.program.uniformVector(this.GLlights[iii].oGLcolor, lights[iii].getColor());
|
this.program.uniformVector(this.GLlights[iii].oGLcolor, lights[iii].getColor());
|
||||||
this.program.uniformVector(this.GLlights[iii].oGLattenuation, lights[iii].getAttenuation());
|
this.program.uniformVector(this.GLlights[iii].oGLattenuation, lights[iii].getAttenuation());
|
||||||
} else {
|
} else {
|
||||||
this.program.uniformVector(this.GLlights[iii].oGLposition, new Vector3f(0, 0, 0));
|
this.program.uniformVector(this.GLlights[iii].oGLposition, Vector3f.ZERO);
|
||||||
this.program.uniformVector(this.GLlights[iii].oGLcolor, new Vector3f(0, 0, 0));
|
this.program.uniformVector(this.GLlights[iii].oGLcolor, Vector3f.ZERO);
|
||||||
this.program.uniformVector(this.GLlights[iii].oGLattenuation, new Vector3f(1, 0, 0));
|
this.program.uniformVector(this.GLlights[iii].oGLattenuation, new Vector3f(1, 0, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user