0e3982591e
MyBuiltinTexturedScene (number 7) displays a cube that loads its faces from a hard-coded texture. Mipmaping is supported. Just use the XXX_MIPMAP_XXX Min/Mag filters to use it. TODO next is combining lighting and textures and then up after that is shadows. I may just do lighting and shadows before lighting, shadows, and textures.
13 lines
239 B
GLSL
13 lines
239 B
GLSL
#version 430
|
|
in vec2 fragment_uv;
|
|
|
|
out vec4 frag_color;
|
|
|
|
layout(location = 4) uniform sampler2D tex;
|
|
|
|
void main()
|
|
{
|
|
vec3 base = vec3(0.1, 0.1, 0.1);
|
|
vec4 sampled = texture(tex, fragment_uv);
|
|
frag_color = vec4(base + sampled.xyz, 1.0);
|
|
} |