Skip to content

Commit 79ee8f4

Browse files
committed
use existing resource directory
1 parent 4ce5b08 commit 79ee8f4

File tree

10 files changed

+69
-198
lines changed

10 files changed

+69
-198
lines changed

examples/models/models_skybox.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
skybox = rl.LoadModelFromMesh(cube)
1313

1414
skybox.materials[0].shader = rl.LoadShader(
15-
b'res/shader/skybox.vs.glsl',
16-
b'res/shader/skybox.fs.glsl'
15+
b'resources/shaders/skybox.vs',
16+
b'resources/shaders/skybox.fs'
1717
)
1818

1919
rl.SetShaderValue(
@@ -24,8 +24,8 @@
2424
)
2525

2626
shdrCubemap = rl.LoadShader(
27-
b'res/shader/cubemap.vs.glsl',
28-
b'res/shader/cubemap.fs.glsl'
27+
b'resources/shaders/cubemap.vs',
28+
b'resources/shaders/cubemap.fs'
2929
)
3030

3131
rl.SetShaderValue(
@@ -35,7 +35,7 @@
3535
rl.UNIFORM_INT
3636
)
3737

38-
texHDR = rl.LoadTexture(b'res/img/skymap.hdr')
38+
texHDR = rl.LoadTexture(b'resources/dresden_square.hdr')
3939

4040
skybox.materials[0].maps[rl.MAP_CUBEMAP].texture = rl.GenTextureCubemap(shdrCubemap, texHDR, 512);
4141

examples/models/resources/shaders/cubemap.fs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@
88

99
#version 330
1010

11-
# Input vertex attributes (from vertex shader)
12-
in vec3 fragPos
11+
// Input vertex attributes (from vertex shader)
12+
in vec3 fragPosition;
1313

14-
# Input uniform values
15-
uniform sampler2D equirectangularMap
14+
// Input uniform values
15+
uniform sampler2D equirectangularMap;
1616

17-
# Output fragment color
18-
out vec4 finalColor
17+
// Output fragment color
18+
out vec4 finalColor;
1919

2020
vec2 SampleSphericalMap(vec3 v)
21-
[
22-
vec2 uv = vec2(atan(v.z, v.x), asin(v.y))
23-
uv *= vec2(0.1591, 0.3183)
24-
uv += 0.5
25-
return uv
26-
]
21+
{
22+
vec2 uv = vec2(atan(v.z, v.x), asin(v.y));
23+
uv *= vec2(0.1591, 0.3183);
24+
uv += 0.5;
25+
return uv;
26+
}
2727

2828
void main()
29-
[
30-
# Normalize local position
31-
vec2 uv = SampleSphericalMap(normalize(fragPos))
29+
{
30+
// Normalize local position
31+
vec2 uv = SampleSphericalMap(normalize(fragPosition));
3232

33-
# Fetch color from texture map
34-
vec3 color = texture(equirectangularMap, uv).rgb
33+
// Fetch color from texture map
34+
vec3 color = texture(equirectangularMap, uv).rgb;
3535

36-
# Calculate final fragment color
37-
finalColor = vec4(color, 1.0)
38-
]
36+
// Calculate final fragment color
37+
finalColor = vec4(color, 1.0);
38+
}

examples/models/resources/shaders/cubemap.vs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88

99
#version 330
1010

11-
# Input vertex attributes
12-
in vec3 vertexPosition
11+
// Input vertex attributes
12+
in vec3 vertexPosition;
1313

14-
# Input uniform values
15-
uniform mat4 projection
16-
uniform mat4 view
14+
// Input uniform values
15+
uniform mat4 projection;
16+
uniform mat4 view;
1717

18-
# Output vertex attributes (to fragment shader)
19-
out vec3 fragPos
18+
// Output vertex attributes (to fragment shader)
19+
out vec3 fragPosition;
2020

2121
void main()
22-
[
23-
# Calculate fragment position based on model transformations
24-
fragPos = vertexPosition
22+
{
23+
// Calculate fragment position based on model transformations
24+
fragPosition = vertexPosition;
2525

26-
# Calculate final vertex position
27-
gl_Position = projection*view*vec4(vertexPosition, 1.0)
28-
]
26+
// Calculate final vertex position
27+
gl_Position = projection*view*vec4(vertexPosition, 1.0);
28+
}

examples/models/resources/shaders/skybox.fs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88

99
#version 330
1010

11-
# Input vertex attributes (from vertex shader)
12-
in vec3 fragPos
11+
// Input vertex attributes (from vertex shader)
12+
in vec3 fragPosition;
1313

14-
# Input uniform values
15-
uniform samplerCube environmentMap
14+
// Input uniform values
15+
uniform samplerCube environmentMap;
1616

17-
# Output fragment color
18-
out vec4 finalColor
17+
// Output fragment color
18+
out vec4 finalColor;
1919

2020
void main()
21-
[
22-
# Fetch color from texture map
23-
vec3 color = texture(environmentMap, fragPos).rgb
21+
{
22+
// Fetch color from texture map
23+
vec3 color = texture(environmentMap, fragPosition).rgb;
2424

25-
# Apply gamma correction
26-
color = color/(color + vec3(1.0))
27-
color = pow(color, vec3(1.0/2.2))
25+
// Apply gamma correction
26+
color = color/(color + vec3(1.0));
27+
color = pow(color, vec3(1.0/2.2));
2828

29-
# Calculate final fragment color
30-
finalColor = vec4(color, 1.0)
31-
]
29+
// Calculate final fragment color
30+
finalColor = vec4(color, 1.0);
31+
}

examples/models/resources/shaders/skybox.vs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88

99
#version 330
1010

11-
# Input vertex attributes
12-
in vec3 vertexPosition
11+
// Input vertex attributes
12+
in vec3 vertexPosition;
1313

14-
# Input uniform values
15-
uniform mat4 projection
16-
uniform mat4 view
14+
// Input uniform values
15+
uniform mat4 projection;
16+
uniform mat4 view;
1717

18-
# Output vertex attributes (to fragment shader)
19-
out vec3 fragPos
18+
// Output vertex attributes (to fragment shader)
19+
out vec3 fragPosition;
2020

2121
void main()
22-
[
23-
# Calculate fragment position based on model transformations
24-
fragPos = vertexPosition
22+
{
23+
// Calculate fragment position based on model transformations
24+
fragPosition = vertexPosition;
2525

26-
# Remove translation from the view matrix
27-
mat4 rotView = mat4(mat3(view))
28-
vec4 clipPos = projection*rotView*vec4(vertexPosition, 1.0)
26+
// Remove translation from the view matrix
27+
mat4 rotView = mat4(mat3(view));
28+
vec4 clipPos = projection*rotView*vec4(vertexPosition, 1.0);
2929

30-
# Calculate final vertex position
31-
gl_Position = clipPos.xyww
32-
]
30+
// Calculate final vertex position
31+
gl_Position = clipPos.xyzw;
32+
}

examples/res/img/skymap.hdr

-1.45 MB
Binary file not shown.

examples/res/shader/cubemap.fs.glsl

Lines changed: 0 additions & 38 deletions
This file was deleted.

examples/res/shader/cubemap.vs.glsl

Lines changed: 0 additions & 28 deletions
This file was deleted.

examples/res/shader/skybox.fs.glsl

Lines changed: 0 additions & 31 deletions
This file was deleted.

examples/res/shader/skybox.vs.glsl

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)