diff --git a/core/Material.cpp b/core/Material.cpp index a11469e..4f3a589 100644 --- a/core/Material.cpp +++ b/core/Material.cpp @@ -22,9 +22,9 @@ Texture Texture::FromFile(const char *filename) { glBindTexture(GL_TEXTURE_2D, tex.id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); int nrChannels; unsigned char* data = stbi_load(filename, &tex.width, &tex.height, &nrChannels, 0); diff --git a/demo/cube.glb b/demo/cube.glb deleted file mode 100644 index 0f1a5cd..0000000 Binary files a/demo/cube.glb and /dev/null differ diff --git a/demo/main.lua b/demo/main.lua index 1964701..44035ba 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -41,11 +41,12 @@ function init() ball1.transform:Translate(0.0, 3.0, 0.0) - cube = couch.Mesh.FromFile("cube.glb") - cube:SetupMesh(); - cube.material.tex = couch.Texture.FromFile("container.png") - cube.material.usesTex = true - couch.Node.GetRoot().children:Append(cube) + trough = couch.Mesh.FromFile("trough.glb") + trough:SetupMesh() + trough.material.tex = couch.Texture.FromFile("wood_lowres.png") + trough.material.usesTex = true + couch.Node.GetRoot().children:Append(trough) + trough.transform:Translate(10.0, 0.0, 0.0) end function update(delta) diff --git a/demo/trough.glb b/demo/trough.glb new file mode 100644 index 0000000..9ad428a Binary files /dev/null and b/demo/trough.glb differ diff --git a/demo/wood_lowres.png b/demo/wood_lowres.png new file mode 100644 index 0000000..4dd008d Binary files /dev/null and b/demo/wood_lowres.png differ