-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Joint effort by Petr Ohlidal (@only-a-ptr), @tritonas00, @AnotherFoxGuy ⬆️ Updated mygui, pagedgeometry and caelum 🐛 Fixed missing MyGUI shaders 🐛 Fixed MyGUI rendering issue 🔧 Build OGRE with resourcemanager_strict=off updated rtshader media 🐛 Fixed cmake not accepting `CMAKE_CONFIGURATION_TYPES` fixed odef lights scenenode 🐛 Fixed Caelum not loading os files Caelum time slider: restored original code (it works with latest Ogre master branch) 🐛 Fixed Imgui inverted colours on DirectX 9 fixed survey map texture updating ⬆️ Update OGRE to 13.5 updated rtshader media for Ogre 13.5 🔧 Implement PSSM3 properly ⬆️ Update OGRE to 13.5.1 Fixed crash on loading 2nd terrain w/envmap enabled ⬆️ Update OGRE to 13.5.3 Fixed crash on 2nd map load (procedural road material conflict) Media: fix corrupted DDS texture crashing under D3D9
- Loading branch information
Showing
203 changed files
with
5,282 additions
and
8,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "OgreUnifiedShader.h" | ||
|
||
struct RasterizerData | ||
{ | ||
vec4 pos [[position]]; | ||
vec2 uv; | ||
}; | ||
|
||
struct Vertex | ||
{ | ||
IN(vec3 pos, POSITION); | ||
IN(vec2 uv, TEXCOORD0); | ||
}; | ||
|
||
struct Uniform | ||
{ | ||
mat4 mvpMtx; | ||
mat4 texMtx; | ||
}; | ||
|
||
// first 15 slots are reserved for the vertex attributes | ||
#define UNIFORM_INDEX_START 16 | ||
|
||
vertex RasterizerData default_vp(Vertex in [[stage_in]], | ||
constant Uniform& u [[buffer(UNIFORM_INDEX_START)]]) | ||
{ | ||
RasterizerData out; | ||
out.pos = u.mvpMtx * vec4(in.pos, 1); | ||
out.uv = (u.texMtx * vec4(in.uv,1,1)).xy; | ||
return out; | ||
} | ||
|
||
fragment half4 default_fp(RasterizerData in [[stage_in]], | ||
metal::texture2d<half> tex [[texture(0)]], | ||
metal::sampler s [[sampler(0)]]) | ||
{ | ||
return tex.sample(s, in.uv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// This file is part of the OGRE project. | ||
// It is subject to the license terms in the LICENSE file found in the top-level directory | ||
// of this distribution and at https://www.ogre3d.org/licensing. | ||
|
||
// @public-api | ||
|
||
#if __VERSION__ == 100 | ||
mat2 transpose(mat2 m) | ||
{ | ||
return mat2(m[0][0], m[1][0], | ||
m[0][1], m[1][1]); | ||
} | ||
|
||
mat3 transpose(mat3 m) | ||
{ | ||
return mat3(m[0][0], m[1][0], m[2][0], | ||
m[0][1], m[1][1], m[2][1], | ||
m[0][2], m[1][2], m[2][2]); | ||
} | ||
|
||
mat4 transpose(mat4 m) | ||
{ | ||
return mat4(m[0][0], m[1][0], m[2][0], m[3][0], | ||
m[0][1], m[1][1], m[2][1], m[3][1], | ||
m[0][2], m[1][2], m[2][2], m[3][2], | ||
m[0][3], m[1][3], m[2][3], m[3][3]); | ||
} | ||
#endif | ||
|
||
#if __VERSION__ > 120 || defined(OGRE_GLSLANG) | ||
#define texture1D texture | ||
#define texture2D texture | ||
#define texture3D texture | ||
#define texture2DArray texture | ||
#define textureCube texture | ||
#define shadow2D texture | ||
#define shadow2DProj textureProj | ||
#define texture2DProj textureProj | ||
#define texture2DLod textureLod | ||
#define textureCubeLod textureLod | ||
|
||
#if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_VERTEX_SHADER)) || __VERSION__ >= 410 | ||
#define IN(decl, loc) layout(location = loc) in decl; | ||
#else | ||
#define IN(decl, loc) in decl; | ||
#endif | ||
|
||
#if defined(OGRE_GLSLANG) || (__VERSION__ > 150 && defined(OGRE_FRAGMENT_SHADER)) || __VERSION__ >= 410 | ||
#define OUT(decl, loc) layout(location = loc) out decl; | ||
#else | ||
#define OUT(decl, loc) out decl; | ||
#endif | ||
|
||
#else | ||
|
||
#ifdef OGRE_VERTEX_SHADER | ||
#define IN(decl, loc) attribute decl; | ||
#define OUT(decl, loc) varying decl; | ||
#else | ||
#define IN(decl, loc) varying decl; | ||
#define OUT(decl, loc) out decl; | ||
#endif | ||
|
||
#endif | ||
|
||
#if defined(OGRE_FRAGMENT_SHADER) && (defined(OGRE_GLSLANG) || (__VERSION__ > 130)) | ||
#define gl_FragColor FragColor | ||
OUT(vec4 FragColor, 0) | ||
#endif | ||
|
||
#ifdef VULKAN | ||
|
||
#ifdef OGRE_VERTEX_SHADER | ||
#define OGRE_UNIFORMS_BEGIN layout(binding = 0, row_major) uniform OgreUniforms { | ||
#else | ||
#define OGRE_UNIFORMS_BEGIN layout(binding = 1, row_major) uniform OgreUniforms { | ||
#endif | ||
|
||
#define OGRE_UNIFORMS_END }; | ||
|
||
#else | ||
|
||
#define OGRE_UNIFORMS_BEGIN | ||
#define OGRE_UNIFORMS_END | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// This file is part of the OGRE project. | ||
// It is subject to the license terms in the LICENSE file found in the top-level directory | ||
// of this distribution and at https://www.ogre3d.org/licensing. | ||
|
||
// @public-api | ||
|
||
#if OGRE_HLSL >= 4 | ||
|
||
// SM4 separates sampler into Texture and SamplerState | ||
|
||
#define sampler1D Sampler1D | ||
#define sampler2D Sampler2D | ||
#define sampler3D Sampler3D | ||
#define samplerCUBE SamplerCube | ||
|
||
struct Sampler1D | ||
{ | ||
Texture1D t; | ||
SamplerState s; | ||
}; | ||
struct Sampler2D | ||
{ | ||
Texture2D t; | ||
SamplerState s; | ||
}; | ||
struct Sampler3D | ||
{ | ||
Texture3D t; | ||
SamplerState s; | ||
}; | ||
struct SamplerCube | ||
{ | ||
TextureCube t; | ||
SamplerState s; | ||
}; | ||
|
||
float4 tex1D(Sampler1D s, float v) { return s.t.Sample(s.s, v); } | ||
float4 tex2D(Sampler2D s, float2 v) { return s.t.Sample(s.s, v); } | ||
float4 tex3D(Sampler3D s, float3 v) { return s.t.Sample(s.s, v); } | ||
float4 texCUBE(SamplerCube s, float3 v) { return s.t.Sample(s.s, v); } | ||
|
||
float4 tex2D(Sampler2D s, float2 v, float2 ddx, float2 ddy) { return s.t.SampleGrad(s.s, v, ddx, ddy); } | ||
float4 tex2Dproj(Sampler2D s, float4 v) { return s.t.Sample(s.s, v.xy/v.w); } | ||
float4 tex2Dlod(Sampler2D s, float4 v) { return s.t.SampleLevel(s.s, v.xy, v.w); } | ||
|
||
#define SAMPLER1D(name, reg) \ | ||
Texture1D name ## Tex : register(t ## reg);\ | ||
SamplerState name ## State : register(s ## reg);\ | ||
static Sampler1D name = {name ## Tex, name ## State} | ||
|
||
#define SAMPLER2D(name, reg) \ | ||
Texture2D name ## Tex : register(t ## reg);\ | ||
SamplerState name ## State : register(s ## reg);\ | ||
static Sampler2D name = {name ## Tex, name ## State} | ||
|
||
#define SAMPLER3D(name, reg) \ | ||
Texture3D name ## Tex : register(t ## reg);\ | ||
SamplerState name ## State : register(s ## reg);\ | ||
static Sampler3D name = {name ## Tex, name ## State} | ||
|
||
#define SAMPLERCUBE(name, reg) \ | ||
TextureCube name ## Tex : register(t ## reg);\ | ||
SamplerState name ## State : register(s ## reg);\ | ||
static SamplerCube name = {name ## Tex, name ## State} | ||
|
||
// the following are not available in D3D9, but provided for convenience | ||
struct Sampler2DShadow | ||
{ | ||
Texture2D t; | ||
SamplerComparisonState s; | ||
}; | ||
struct Sampler2DArray | ||
{ | ||
Texture2DArray t; | ||
SamplerState s; | ||
}; | ||
|
||
#define SAMPLER2DSHADOW(name, reg) \ | ||
Texture2D name ## Tex : register(t ## reg);\ | ||
SamplerComparisonState name ## State : register(s ## reg);\ | ||
static Sampler2DShadow name = {name ## Tex, name ## State} | ||
|
||
#define SAMPLER2DARRAY(name, reg) \ | ||
Texture2DArray name ## Tex : register(t ## reg);\ | ||
SamplerState name ## State : register(s ## reg);\ | ||
static Sampler2DArray name = {name ## Tex, name ## State} | ||
|
||
float tex2Dcmp(Sampler2DShadow s, float3 v) { return s.t.SampleCmpLevelZero(s.s, v.xy, v.z); } | ||
float4 tex2DARRAY(Sampler2DArray s, float3 v) { return s.t.Sample(s.s, v); } | ||
#else | ||
|
||
#define SAMPLER1D(name, reg) sampler1D name : register(s ## reg) | ||
#define SAMPLER2D(name, reg) sampler2D name : register(s ## reg) | ||
#define SAMPLER3D(name, reg) sampler3D name : register(s ## reg) | ||
#define SAMPLERCUBE(name, reg) samplerCUBE name : register(s ## reg) | ||
|
||
#endif |
Oops, something went wrong.