diff --git a/examples/dminer/src/dminer/core/blocks.d b/examples/dminer/src/dminer/core/blocks.d index e3672efc..d002d16e 100644 --- a/examples/dminer/src/dminer/core/blocks.d +++ b/examples/dminer/src/dminer/core/blocks.d @@ -89,21 +89,23 @@ public: 3 2 */ +immutable float inv = -1.0f; + // pos, normal, color, tx static const float[VERTEX_COMPONENTS * 4] face_vertices_north = [ - -0.5, 0.5, -0.5, 0.0, 0.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, - 0.5, 0.5, -0.5, 0.0, 0.0, -1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, - -0.5, -0.5, -0.5, 0.0, 0.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 0.5, -0.5, -0.5, 0.0, 0.0, -1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, + -0.5, 0.5, -0.5, 0.0, 0.0, -1.0*inv, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, + 0.5, 0.5, -0.5, 0.0, 0.0, -1.0*inv, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, + -0.5, -0.5, -0.5, 0.0, 0.0, -1.0*inv, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 0.5, -0.5, -0.5, 0.0, 0.0, -1.0*inv, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, ]; static const float[VERTEX_COMPONENTS * 4] face_vertices_south = [ - -0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, - 0.5, -0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - -0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, - 0.5, 0.5, 0.5, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, + -0.5, -0.5, 0.5, 0.0, 0.0, 1.0*inv, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, + 0.5, -0.5, 0.5, 0.0, 0.0, 1.0*inv, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + -0.5, 0.5, 0.5, 0.0, 0.0, 1.0*inv, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, + 0.5, 0.5, 0.5, 0.0, 0.0, 1.0*inv, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, ]; static const float[VERTEX_COMPONENTS * 4] face_vertices_west = diff --git a/examples/dminer/src/minermain.d b/examples/dminer/src/minermain.d index 08eb7639..cb0b58ab 100644 --- a/examples/dminer/src/minermain.d +++ b/examples/dminer/src/minermain.d @@ -86,7 +86,7 @@ class UiWidget : VerticalLayout, CellVisitor { dirLightNode.translateX(2); dirLightNode.translateY(3); dirLightNode.translateZ(0); - dirLightNode.light = Light.createPoint(vec3(2, 2, 2), 15); //Light.createDirectional(vec3(1, 0.5, 0.5)); + dirLightNode.light = Light.createPoint(vec3(12, 12, 12), 25); //Light.createDirectional(vec3(1, 0.5, 0.5)); dirLightNode.light.enabled = true; _scene.addChild(dirLightNode); @@ -134,8 +134,9 @@ class UiWidget : VerticalLayout, CellVisitor { updateMinerMesh(); Material minerMaterial = new Material(EffectId("textured.vert", "textured.frag", null), "blocks"); - minerMaterial.ambientColor = vec3(0.2,0.2,0.2); + minerMaterial.ambientColor = vec3(0.05,0.05,0.05); minerMaterial.textureLinear = false; + minerMaterial.specular = true; Model minerDrawable = new Model(minerMaterial, _minerMesh); Node3d minerNode = new Node3d("miner", minerDrawable); _scene.addChild(minerNode); diff --git a/src/dlangui/graphics/glsupport.d b/src/dlangui/graphics/glsupport.d index 1b25f872..5bbb1dc2 100644 --- a/src/dlangui/graphics/glsupport.d +++ b/src/dlangui/graphics/glsupport.d @@ -1240,7 +1240,7 @@ class GLObject(GLObjectTypes type, GLuint target = 0) { glTexParameteri(target, GL_TEXTURE_MAG_FILTER, linear ? GL_LINEAR : GL_NEAREST); glTexParameteri(target, GL_TEXTURE_MIN_FILTER, linear ? (!mipmap ? GL_LINEAR : GL_LINEAR_MIPMAP_LINEAR) : - (!mipmap ? GL_NEAREST : GL_LINEAR_MIPMAP_LINEAR)); //GL_NEAREST_MIPMAP_NEAREST + (!mipmap ? GL_NEAREST : GL_NEAREST_MIPMAP_NEAREST)); //GL_NEAREST_MIPMAP_NEAREST checkError("filtering - glTexParameteri"); if(clamp) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);