mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 19:50:03 -06:00
Change definition of for loop statements in shader preprocessor to include both max and min.
This commit is contained in:
Submodule ext/ghoul updated: 5c9f358af8...f3420c0b5c
@@ -38,12 +38,13 @@ in vec2 fs_uv;
|
||||
Fragment getFragment() {
|
||||
Fragment frag;
|
||||
|
||||
#for i in 0..#{numLayersColor}
|
||||
#for j in 1..#{numLayersColor}
|
||||
{
|
||||
int i = #{j} - 1;
|
||||
vec2 samplePos =
|
||||
colorTiles[#{i}].uvTransform.uvScale * fs_uv +
|
||||
colorTiles[#{i}].uvTransform.uvOffset;
|
||||
vec4 colorSample = texture(colorTiles[#{i}].textureSampler, samplePos);
|
||||
colorTiles[i].uvTransform.uvScale * fs_uv +
|
||||
colorTiles[i].uvTransform.uvOffset;
|
||||
vec4 colorSample = texture(colorTiles[i].textureSampler, samplePos);
|
||||
frag.color = blendOver(frag.color, colorSample);
|
||||
}
|
||||
#endfor
|
||||
|
||||
@@ -61,18 +61,19 @@ void main()
|
||||
|
||||
float height = 0;
|
||||
|
||||
#for i in 0..#{numLayersHeight}
|
||||
#for j in 1..#{numLayersHeight}
|
||||
{
|
||||
int i = #{j} - 1;
|
||||
vec2 samplePos =
|
||||
heightTiles[#{i}].uvTransform.uvScale * in_uv +
|
||||
heightTiles[#{i}].uvTransform.uvOffset;
|
||||
heightTiles[i].uvTransform.uvScale * in_uv +
|
||||
heightTiles[i].uvTransform.uvOffset;
|
||||
|
||||
float sampledValue = texture(heightTiles[#{i}].textureSampler, samplePos).r;
|
||||
float sampledValue = texture(heightTiles[i].textureSampler, samplePos).r;
|
||||
|
||||
// TODO : Some kind of blending here. Now it just writes over
|
||||
height = (sampledValue *
|
||||
heightTiles[#{i}].depthTransform.depthScale +
|
||||
heightTiles[#{i}].depthTransform.depthOffset);
|
||||
heightTiles[i].depthTransform.depthScale +
|
||||
heightTiles[i].depthTransform.depthOffset);
|
||||
|
||||
// Skirts
|
||||
int vertexIDx = gl_VertexID % (xSegments + 3);
|
||||
|
||||
@@ -38,12 +38,13 @@ in vec2 fs_uv;
|
||||
Fragment getFragment() {
|
||||
Fragment frag;
|
||||
|
||||
#for i in 0..#{numLayersColor}
|
||||
#for j in 1..#{numLayersColor}
|
||||
{
|
||||
int i = #{j} - 1;
|
||||
vec2 samplePos =
|
||||
colorTiles[#{i}].uvTransform.uvScale * fs_uv +
|
||||
colorTiles[#{i}].uvTransform.uvOffset;
|
||||
vec4 colorSample = texture(colorTiles[#{i}].textureSampler, samplePos);
|
||||
colorTiles[i].uvTransform.uvScale * fs_uv +
|
||||
colorTiles[i].uvTransform.uvOffset;
|
||||
vec4 colorSample = texture(colorTiles[i].textureSampler, samplePos);
|
||||
frag.color = blendOver(frag.color, colorSample);
|
||||
}
|
||||
#endfor
|
||||
|
||||
@@ -65,18 +65,19 @@ void main()
|
||||
|
||||
float height = 0;
|
||||
|
||||
#for i in 0..#{numLayersHeight}
|
||||
#for j in 1..#{numLayersHeight}
|
||||
{
|
||||
int i = #{j} - 1;
|
||||
vec2 samplePos =
|
||||
heightTiles[#{i}].uvTransform.uvScale * in_uv +
|
||||
heightTiles[#{i}].uvTransform.uvOffset;
|
||||
heightTiles[i].uvTransform.uvScale * in_uv +
|
||||
heightTiles[i].uvTransform.uvOffset;
|
||||
|
||||
float sampledValue = texture(heightTiles[#{i}].textureSampler, samplePos).r;
|
||||
float sampledValue = texture(heightTiles[i].textureSampler, samplePos).r;
|
||||
|
||||
// TODO : Some kind of blending here. Now it just writes over
|
||||
height = (sampledValue *
|
||||
heightTiles[#{i}].depthTransform.depthScale +
|
||||
heightTiles[#{i}].depthTransform.depthOffset);
|
||||
heightTiles[i].depthTransform.depthScale +
|
||||
heightTiles[i].depthTransform.depthOffset);
|
||||
|
||||
// Skirts
|
||||
int vertexIDx = gl_VertexID % (xSegments + 3);
|
||||
|
||||
Reference in New Issue
Block a user