light/Engine/res/Shaders/TextureShader.h
Light 2ab97d3863 Major Maintenance
- Major tidying
- Moved 'RendererProgram' classes out of the 'Renderer' class
- Moved 'RenderCommand' member variable out of 'GraphicsContext' and into
       the 'Renderer' class as a unique_ptr. results in 'Renderer' taking a
       windowHandle for construction
- Defined new macros for max quads in 'Renderer.h'
- Added the 'Stringifier' to 'Base.h'
- Added the 'ResourceManager' to the 'LightEngine.h'
- Application now logs the current file directory
- Fixed the forward declaration in GraphicsContext
- Fixed the debug break in Base.h
- Fixed 'dxShader' not logging compile errors
- 'glVertexLayout' now takes in a shared_ptr for 'VertexBuffer'
- 'glShader' now logs the shader compilation errors properly
- 'dxVertexLayout' now takes in a shared_ptr for 'Shader"
- Modified 'dxSharedContext' members to be private and made getters for them
- 'dxRenderCommand::SwapBuffers' now throws dxException for
       DXGI_ERROR_DEVICE_REMOD error
2021-07-01 19:25:46 +04:30

65 lines
No EOL
1,008 B
C

#define LT_ENGINE_RESOURCES_TEXTURE_SHADER_VS \
R"(
+GLSL
#version 440 core
layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec2 a_TexCoord;
out vec2 vso_TexCoord;
void main()
{
gl_Position = vec4(a_Position, 1.0);
vso_TexCoord = a_TexCoord;
}
-GLSL
+HLSL
struct VertexOut
{
float2 TexChoord : TEXCHOORD;
float4 Position : SV_Position;
};
VertexOut main(float3 InPosition : POSITION, float2 InTexChoord : TEXCHOORD)
{
VertexOut vso;
vso.Position = float4(InPosition, 1.0);
vso.TexChoord = InTexChoord;
return vso;
}
-HLSL
)"
#define LT_ENGINE_RESOURCES_TEXTURE_SHADER_PS \
R"(
+GLSL
#version 440 core
in vec2 vso_TexCoord;
uniform sampler2D u_Texture;
out vec4 fso_FragmentColor;
void main()
{
fso_FragmentColor = texture(u_Texture, vso_TexCoord);
}
-GLSL
+HLSL
sampler samplerState : register(s0);
Texture2D<float4> myTexture : register(t0);
float4 main(float2 InTexChoord : TEXCHOORD) : SV_Target
{
return myTexture.Sample(samplerState, InTexChoord);
}
-HLSL
)"