Permalink
Browse files

Renamed all texture* builtins to Texture*

Changed ToLower xtrans utility function to only lowercase the first char.
Updated all samples
  • Loading branch information...
1 parent 0fcbade commit e9fcb89722c4212ee24bd990e8a708df5b4d137f @WolfgangSt WolfgangSt committed Oct 20, 2011
@@ -69,7 +69,7 @@ public void ClipmapVertexMain()
_uv = (Vertex.xy + FineBlockOrigin.xy) * FineBlockOrigin.zw;
- var texel = new vec3(textureLod(Heightmap, _uv, 1.0f).r);
+ var texel = new vec3(TextureLod(Heightmap, _uv, 1.0f).r);
var zfZd = texel.x * 512.0f;
var zf = Floor(zfZd) * 0.001953125f;
@@ -91,8 +91,8 @@ public void ClipmapVertexMain()
// just for testing, derive normal using interpolation over heights
- var dfdx = (textureLod(Heightmap, _uv + new vec2(FineBlockOrigin.z, 0.0f), 1.0f).r - texel.r);
- var dfdy = (textureLod(Heightmap, _uv + new vec2(0.0f, FineBlockOrigin.w), 1.0f).r - texel.r);
+ var dfdx = (TextureLod(Heightmap, _uv + new vec2(FineBlockOrigin.z, 0.0f), 1.0f).r - texel.r);
+ var dfdy = (TextureLod(Heightmap, _uv + new vec2(0.0f, FineBlockOrigin.w), 1.0f).r - texel.r);
var dz = 2.0f * ScaleFactor.z - dfdx * dfdx - dfdy * dfdy;
Normal = new vec3(dfdx, dfdy, dz);
@@ -24,11 +24,11 @@ public vec4 WangAt(vec2 tex)
var address = tex - tex % (1.0f / 256.0f);
var subPos = Fraction(tex * 256.0f) / 4.0f;
- var offset = texture(WangMap, Fraction(address)).xw;
+ var offset = Texture(WangMap, Fraction(address)).xw;
var tc = offset + subPos;
var tileScaledTex = tex * new vec2(32.0f / 1.0f);
- return textureGrad(WangTiles, tc, DeriveTowardsX(tileScaledTex), DeriveTowardsY(tileScaledTex));
+ return TextureGrad(WangTiles, tc, DeriveTowardsX(tileScaledTex), DeriveTowardsY(tileScaledTex));
}
public override void Begin()
@@ -117,13 +117,13 @@ protected vec3 Fade(vec3 t)
[FragmentShader]
protected vec4 Perm2D(vec2 p)
{
- return texture(PermSampler2D, p);
+ return Texture(PermSampler2D, p);
}
[FragmentShader]
protected float GradPerm(float x, vec3 p)
{
- return Dot(texture(PermGradSampler, x).xyz, p);
+ return Dot(Texture(PermGradSampler, x).xyz, p);
}
[FragmentShader]
@@ -22,11 +22,11 @@ public vec4 WangAt(vec2 tex)
{
var address = tex - tex % (1.0f / 256.0f);
var subPos = Fraction(tex * 256.0f) / 4.0f;
- var offset = texture(WangMap, Fraction(address)).xw;
+ var offset = Texture(WangMap, Fraction(address)).xw;
var tc = offset + subPos;
var tileScaledTex = tex * new vec2(32.0f / 1.0f);
- return textureGrad(WangTiles, tc, DeriveTowardsX(tileScaledTex), DeriveTowardsY(tileScaledTex));
+ return TextureGrad(WangTiles, tc, DeriveTowardsX(tileScaledTex), DeriveTowardsY(tileScaledTex));
}
public override void Begin()
@@ -55,7 +55,7 @@ public void ClipmapVertexMain()
var worldPos = (Vertex.xy + ScaleFactor.xy) * ScaleFactor.zz;
_uv = (Vertex.xy + FineBlockOrigin.xy) * ScaleFactor.ww;
- var texel = new vec3(texture(Heightmap, _uv, 1.0f).r);
+ var texel = new vec3(Texture(Heightmap, _uv, 1.0f).r);
var zfZd = texel.x * 512.0f;
var zd = (Floor(zfZd) + 1.0f) * 0.001953125f;
@@ -81,8 +81,8 @@ public void ClipmapVertexMain()
// just for testing, derive normal using interpolation over heights
- var dfdx = (textureLod(Heightmap, _uv + new vec2(ScaleFactor.w, 0.0f), 1.0f).r - texel.r);
- var dfdy = (textureLod(Heightmap, _uv + new vec2(0.0f, ScaleFactor.w), 1.0f).r - texel.r);
+ var dfdx = (TextureLod(Heightmap, _uv + new vec2(ScaleFactor.w, 0.0f), 1.0f).r - texel.r);
+ var dfdy = (TextureLod(Heightmap, _uv + new vec2(0.0f, ScaleFactor.w), 1.0f).r - texel.r);
var dz = 2.0f*ScaleFactor.z - dfdx * dfdx - dfdy * dfdy;
Normal = new vec3(dfdx, dfdy, dz);
@@ -47,7 +47,7 @@ public void DebugFragmentMain()
var uvs = _uv * HeightSize.xy;
var subUv = Fraction(uvs);
var val = (uvs - subUv + new vec2(0.5f)) / HeightSize.xy;
- var height = texture(Heightmap, val);
+ var height = Texture(Heightmap, val);
//var height = new vec4(1.0f);
var idx = height.r * 255.0f;
@@ -59,7 +59,7 @@ public void DebugFragmentMain()
var tileUv = new vec2(subUv.x/16.0f + xidx, (1.0f-subUv.y)/16.0f + yidx);
- FragColor = texture(DebugTex, tileUv);
+ FragColor = Texture(DebugTex, tileUv);
//FragColor = height;
@@ -70,7 +70,7 @@ public void ClipmapVertexMain()
_uv = (Vertex.xy + FineBlockOrigin.xy) * FineBlockOrigin.zw;
- var texel = new vec3(textureLod(Heightmap, _uv, 1.0f).r);
+ var texel = new vec3(TextureLod(Heightmap, _uv, 1.0f).r);
var zfZd = texel.x * 512.0f;
var zf = Floor(zfZd) * 0.001953125f;
@@ -92,8 +92,8 @@ public void ClipmapVertexMain()
// just for testing, derive normal using interpolation over heights
- var dfdx = (textureLod(Heightmap, _uv + new vec2(FineBlockOrigin.z, 0.0f), 1.0f).r - texel.r);
- var dfdy = (textureLod(Heightmap, _uv + new vec2(0.0f, FineBlockOrigin.w), 1.0f).r - texel.r);
+ var dfdx = (TextureLod(Heightmap, _uv + new vec2(FineBlockOrigin.z, 0.0f), 1.0f).r - texel.r);
+ var dfdy = (TextureLod(Heightmap, _uv + new vec2(0.0f, FineBlockOrigin.w), 1.0f).r - texel.r);
var dz = 2.0f * ScaleFactor.z - dfdx * dfdx - dfdy * dfdy;
Normal = new vec3(dfdx, dfdy, dz);
@@ -22,11 +22,11 @@ public vec4 WangAt(vec2 tex)
{
var address = tex - tex % (1.0f / 256.0f);
var subPos = Fraction(tex * 256.0f) / 4.0f;
- var offset = texture(WangMap, Fraction(address)).xw;
+ var offset = Texture(WangMap, Fraction(address)).xw;
var tc = offset + subPos;
var tileScaledTex = tex * new vec2(32.0f / 1.0f);
- return textureGrad(WangTiles, tc, DeriveTowardsX(tileScaledTex), DeriveTowardsY(tileScaledTex));
+ return TextureGrad(WangTiles, tc, DeriveTowardsX(tileScaledTex), DeriveTowardsY(tileScaledTex));
}
public override void Begin()
@@ -476,13 +476,13 @@ public abstract partial class ShaderDefinition
#region determinant (double)
/// <summary>Returns the determinant of m. </summary>
- protected float determinant(dmat2 m) { throw _invalidAccess; }
+ protected double determinant(dmat2 m) { throw _invalidAccess; }
/// <summary>Returns the determinant of m. </summary>
- protected float determinant(dmat3 m) { throw _invalidAccess; }
+ protected double determinant(dmat3 m) { throw _invalidAccess; }
/// <summary>Returns the determinant of m. </summary>
- protected float determinant(dmat4 m) { throw _invalidAccess; }
+ protected double determinant(dmat4 m) { throw _invalidAccess; }
#endregion
}
Oops, something went wrong.

0 comments on commit e9fcb89

Please sign in to comment.