Update examples
This commit is contained in:
parent
2a0340eb70
commit
ee66ee4d8e
14 changed files with 46 additions and 43 deletions
|
@ -7,7 +7,7 @@ in vec3 vertexNormal;
|
|||
in vec4 vertexColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 mvpMatrix;
|
||||
uniform mat4 mvp;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec2 fragTexCoord;
|
||||
|
@ -22,5 +22,5 @@ void main()
|
|||
fragColor = vertexColor;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ func main() {
|
|||
dwarf := raylib.LoadModel("dwarf.obj") // Load OBJ model
|
||||
texture := raylib.LoadTexture("dwarf_diffuse.png") // Load model texture
|
||||
|
||||
dwarf.Material.TexDiffuse = texture // Bind texture to model
|
||||
dwarf.Material.Maps[raylib.MapDiffuse].Texture = texture // Set dwarf model diffuse texture
|
||||
|
||||
position := raylib.NewVector3(0.0, 0.0, 0.0) // Set model position
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ in vec3 vertexNormal;
|
|||
in vec4 vertexColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 mvpMatrix;
|
||||
uniform mat4 mvp;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec2 fragTexCoord;
|
||||
|
@ -22,5 +22,5 @@ void main()
|
|||
fragColor = vertexColor;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ func main() {
|
|||
texture := raylib.LoadTexture("dwarf_diffuse.png") // Load model texture
|
||||
shader := raylib.LoadShader("glsl330/base.vs", "glsl330/grayscale.fs") // Load model shader
|
||||
|
||||
dwarf.Material.Shader = shader // Set shader effect to 3d model
|
||||
dwarf.Material.TexDiffuse = texture // Bind texture to model
|
||||
dwarf.Material.Shader = shader // Set shader effect to 3d model
|
||||
dwarf.Material.Maps[raylib.MapDiffuse].Texture = texture // Set dwarf model diffuse texture
|
||||
|
||||
position := raylib.NewVector3(0.0, 0.0, 0.0) // Set model position
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ in vec3 vertexNormal;
|
|||
in vec4 vertexColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 mvpMatrix;
|
||||
uniform mat4 mvp;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec2 fragTexCoord;
|
||||
|
@ -22,5 +22,5 @@ void main()
|
|||
fragColor = vertexColor;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,8 @@ func main() {
|
|||
|
||||
dwarf := raylib.LoadModel("dwarf.obj") // Load OBJ model
|
||||
texture := raylib.LoadTexture("dwarf_diffuse.png") // Load model texture
|
||||
dwarf.Material.TexDiffuse = texture // Set dwarf model diffuse texture
|
||||
|
||||
dwarf.Material.Maps[raylib.MapDiffuse].Texture = texture // Set dwarf model diffuse texture
|
||||
|
||||
position := raylib.NewVector3(0.0, 0.0, 0.0) // Set model position
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ in vec3 vertexNormal;
|
|||
in vec4 vertexColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 mvpMatrix;
|
||||
uniform mat4 mvp;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec2 fragTexCoord;
|
||||
|
@ -22,5 +22,5 @@ void main()
|
|||
fragColor = vertexColor;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvpMatrix*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
gl_Position = mvp*vec4(vertexPosition, 1.0);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ func main() {
|
|||
raylib.DrawText("USING CUSTOM SHADER", 190, 40, 10, raylib.Red)
|
||||
|
||||
raylib.DrawRectangle(250-60, 90, 120, 60, raylib.Red)
|
||||
raylib.DrawRectangleGradient(250-90, 170, 180, 130, raylib.Maroon, raylib.Gold)
|
||||
raylib.DrawRectangleGradientH(250-90, 170, 180, 130, raylib.Maroon, raylib.Gold)
|
||||
raylib.DrawRectangleLines(250-40, 320, 80, 60, raylib.Orange)
|
||||
|
||||
// Activate our default shader for next drawings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue