Shaders modif
This commit is contained in:
parent
db4e2d0e86
commit
dc2b696f7e
@ -4,7 +4,7 @@ layout (location = 0) in vec3 aPos;
|
|||||||
layout (location = 1) in vec3 aColor;
|
layout (location = 1) in vec3 aColor;
|
||||||
layout (location = 2) in vec2 aTexCoord;
|
layout (location = 2) in vec2 aTexCoord;
|
||||||
|
|
||||||
out vec4 position;
|
out vec2 fragCoord;
|
||||||
out vec2 texCoord;
|
out vec2 texCoord;
|
||||||
out vec4 color;
|
out vec4 color;
|
||||||
|
|
||||||
@ -17,5 +17,5 @@ void main()
|
|||||||
gl_Position = projection * view * transform * vec4(aPos, 1.0);
|
gl_Position = projection * view * transform * vec4(aPos, 1.0);
|
||||||
color = vec4(aColor, 1.0f);
|
color = vec4(aColor, 1.0f);
|
||||||
texCoord = aTexCoord;
|
texCoord = aTexCoord;
|
||||||
position = vec4(aPos, 1.0);
|
fragCoord = aPos.xy;
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
|
|
||||||
in vec4 color;
|
in vec4 color;
|
||||||
in vec4 position;
|
in vec2 fragCoord;
|
||||||
in vec2 texCoord;
|
in vec2 texCoord;
|
||||||
|
|
||||||
uniform sampler2D texture1;
|
uniform sampler2D texture1;
|
||||||
@ -11,7 +11,7 @@ uniform float time;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{ // Pas fini c'est moche
|
{ // Pas fini c'est moche
|
||||||
vec4 colorPoweredUp = vec4(color.xyz * sin(position.y + time*40) * cos(position.x + time*40), 1.0);
|
vec4 colorPoweredUp = abs(vec4(color.xyz * sin(fragCoord.y + time*20), 1.0));
|
||||||
vec4 tex = texture(texture1, texCoord);
|
vec4 tex = texture(texture1, texCoord);
|
||||||
if (tex.a == 0.0){
|
if (tex.a == 0.0){
|
||||||
FragColor = tex;
|
FragColor = tex;
|
@ -170,8 +170,9 @@ public class Engine {
|
|||||||
zangief.setTextureWrap(58,0,62,84, ObjectGl.STICK_TOP);
|
zangief.setTextureWrap(58,0,62,84, ObjectGl.STICK_TOP);
|
||||||
engine.add_objectGl(zangief);
|
engine.add_objectGl(zangief);
|
||||||
zangief.translate(new Vector3f(-5000.0f,500.0f,10.0f));
|
zangief.translate(new Vector3f(-5000.0f,500.0f,10.0f));
|
||||||
zangief.setColor(new Vector3f(0.5f, 0.0f, 0.0f));
|
zangief.setColor(new Vector3f(0.0f, 0.0f, 1.0f));
|
||||||
// zangief.setShader("shaders/PowerUpShader/VertEnergyWave.glsl","shaders/PowerUpShader/FragEnergyWave.glsl");
|
zangief.useTime = true;
|
||||||
|
zangief.setShader("shaders/StylishShaders/BasicVert.glsl","shaders/StylishShaders/EnergyWave.glsl");
|
||||||
|
|
||||||
// ObjectGl smiley2 = new ObjectGl(0.0f,500.0f,500.0f, 1f, path2, null);
|
// ObjectGl smiley2 = new ObjectGl(0.0f,500.0f,500.0f, 1f, path2, null);
|
||||||
// engine.add_objectGl(smiley2);
|
// engine.add_objectGl(smiley2);
|
||||||
|
@ -29,7 +29,6 @@ public class VertexArray {
|
|||||||
EBO = glGenBuffers();
|
EBO = glGenBuffers();
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, BufferUtils.createByteBuffer(indices), GL_STATIC_DRAW);
|
glBufferData(GL_ELEMENT_ARRAY_BUFFER, BufferUtils.createByteBuffer(indices), GL_STATIC_DRAW);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user