Added [models] example - skybox loading and drawing
This commit is contained in:
parent
553871567e
commit
382cbda3de
4 changed files with 168 additions and 0 deletions
19
examples/models/skybox/skybox.fs
Normal file
19
examples/models/skybox/skybox.fs
Normal file
|
@ -0,0 +1,19 @@
|
|||
#version 330
|
||||
|
||||
// input vertex attributes (from vertex shader)
|
||||
in vec3 fragPosition;
|
||||
|
||||
// input uniform values
|
||||
uniform samplerCube environmentMap;
|
||||
|
||||
// output fragment color
|
||||
out vec4 finalColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
// fetch color from texture map
|
||||
vec3 color = texture(environmentMap, fragPosition).rgb;
|
||||
|
||||
// calculate final fragment color
|
||||
finalColor = vec4(color, 1.0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue