Correct frag shader when using texture + color

This commit is contained in:
Antoine
2021-05-21 19:51:29 +02:00
parent 770d134722
commit 574e31e02d
3 changed files with 6 additions and 12 deletions

View File

@ -32,7 +32,7 @@ public class ObjectGl {
}
/**
* Create a rectangle shape
* Create a rectangle shape, use setTextureWrap to correctly align the texture with the model
* @param z depth of your model the larger it is the more it will be "close" to the camera
* @param h height of the rectangle
* @param w width of the rectangle
@ -112,6 +112,7 @@ public class ObjectGl {
}
public void setTextureWrap(float x, float y, float w, float h){
// TODO set sticky property
this.vertexArray.swapVertexBufferObject(Primitive.createRectangle(this.zPos, w, h));
int texWidth = this.texture.getWidth();
int texHeight = this.texture.getHeight();
@ -128,7 +129,7 @@ public class ObjectGl {
this.setTextureWrap(result);
}
public void setTextureWrap(float[] texture){
private void setTextureWrap(float[] texture){
this.vertexArray.swapTextureBufferObject(texture);
}