23#if defined(OGRE_HLSL) || defined(OGRE_CG)
25#include "HLSL_SM4Support.hlsl"
37#define texture1D tex1D
38#define texture2D tex2D
39#define texture3D tex3D
40#define texture2DArray tex2DARRAY
41#define textureCube texCUBE
42#define shadow2D tex2Dcmp
43#define texture2DProj tex2Dproj
44vec4
texture2DLod(sampler2D s, vec2 v,
float lod) {
return tex2Dlod(s, vec4(v.x, v.y, 0, lod)); }
46#define samplerCube samplerCUBE
47#define sampler2DShadow Sampler2DShadow
51#define inversesqrt rsqrt
52#define mod(x, y) (x - y * floor(x / y))
60 return mat4(a, b, c, d);
70 return transpose(mat3(a, b, c));
90#define OGRE_UNIFORMS_BEGIN
91#define OGRE_UNIFORMS_END
93#define MAIN_PARAMETERS void main(
95#ifdef OGRE_VERTEX_SHADER
96#define MAIN_DECLARATION out float4 gl_Position : POSITION)
98#define MAIN_DECLARATION in float4 gl_FragCoord : POSITION, out float4 gl_FragColor : COLOR)
101#define IN(decl, sem) in decl : sem,
102#define OUT(decl, sem) out decl : sem,
103#elif defined(OGRE_METAL)
107#define mat2 metal::float2x2
108#define mat3 metal::float3x3
109#define mat4 metal::float4x4
111#define IN(decl, sem) decl [[ attribute(sem) ]];
114#include "GLSL_GL3Support.glsl"
116#ifndef USE_OGRE_FROM_FUTURE
117#define _UNIFORM_BINDING(b)
119#define _UNIFORM_BINDING(b) layout(binding = b + 2) uniform
120#elif __VERSION__ >= 420
121#define _UNIFORM_BINDING(b) layout(binding = b) uniform
123#define _UNIFORM_BINDING(b) uniform
126#define SAMPLER1D(name, reg) _UNIFORM_BINDING(reg) sampler1D name
127#define SAMPLER2D(name, reg) _UNIFORM_BINDING(reg) sampler2D name
128#define SAMPLER3D(name, reg) _UNIFORM_BINDING(reg) sampler3D name
129#define SAMPLER2DARRAY(name, reg) _UNIFORM_BINDING(reg) sampler2DArray name
130#define SAMPLERCUBE(name, reg) _UNIFORM_BINDING(reg) samplerCube name
131#define SAMPLER2DSHADOW(name, reg) _UNIFORM_BINDING(reg) sampler2DShadow name
133#define saturate(x) clamp(x, 0.0, 1.0)
134#define mul(a, b) ((a) * (b))
136#define vec2_splat vec2
137#define vec3_splat vec3
138#define vec4_splat vec4
141 return mat2(m[0][0], m[1][0],
146 return mat3(m[0][0], m[1][0], m[2][0],
147 m[0][1], m[1][1], m[2][1],
148 m[0][2], m[1][2], m[2][2]);
152 return mat4(m[0][0], m[1][0], m[2][0], m[3][0],
153 m[0][1], m[1][1], m[2][1], m[3][1],
154 m[0][2], m[1][2], m[2][2], m[3][2],
155 m[0][3], m[1][3], m[2][3], m[3][3]);
170 return mat3(a, b, c);
175#define MAIN_PARAMETERS
176#define MAIN_DECLARATION void main()
180#if !defined(OGRE_HLSL) && !defined(OGRE_CG)
189#define BLENDINDICES 7
201#define OGRE_UNIFORMS(params) OGRE_UNIFORMS_BEGIN params OGRE_UNIFORMS_END
vec4 texture2DLod(sampler2D s, vec2 v, float lod)
mat3 mtxFromCols(vec3 a, vec3 b, vec3 c)
mat4 mtxFromRows(vec4 a, vec4 b, vec4 c, vec4 d)