sbylib ~master (2020-02-29T08:12:18Z)
Dub
Repo
UnrealFloorMaterial
sbylib
graphics
material
standard
unrealfloor
Undocumented in source.
class
UnrealFloorMaterial :
Material
{
mixin
RenderPass
!(
StandardRenderPass
)
;
mixin
ShaderSource
!(
ShaderStage
.
Vertex
,
q{
#version
450
layout
(
location
=
0
)
in
vec3
position
;
layout
(
location
=
1
)
in
vec2
uv
;
layout
(
location
=
0
)
out
vec2
uv2
;
layout
(
binding
=
0
)
uniform
UniformData
{
mat4
worldMatrix
;
mat4
viewMatrix
;
mat4
projectionMatrix
; }
uni
;
void
main
() {
gl_Position
=
uni
.
projectionMatrix
*
uni
.
viewMatrix
*
uni
.
worldMatrix
*
vec4
(
position
,
1
);
gl_Position
.
y
= -
gl_Position
.
y
;
uv2
=
uv
; }
}
)
;
mixin
ShaderSource
!(
ShaderStage
.
Fragment
,
q{
#version
450
layout
(
location
=
0
)
in
vec2
uv
;
layout
(
location
=
0
)
out
vec4
fragColor
;
layout
(
binding
=
1
)
uniform
UniformData
{
vec2
tileSize
; }
uni
;
void
main
() {
vec2
po
=
mod
(
uv
/
uni
.
tileSize
,
2
);
int
x
=
po
.
x
<
1
?
0
:
1
;
int
y
=
po
.
y
<
1
?
0
:
1
;
if
(
x
+
y
==
0
) {
fragColor
=
vec4
(
vec3
(
0.1
),
1
); }
if
(
x
+
y
==
1
) {
fragColor
=
vec4
(
vec3
(
0.2
),
1
); }
else
{
fragColor
=
vec4
(
vec3
(
0.3
),
1
); } }
}
)
;
struct
Vertex
;
immutable
CreateInfo
i
;
mixin
Info
!
i
;
struct
VertexUniform
;
struct
FragmentUniform
;
@
uniform
@
binding
(0)
@
stage
(
ShaderStage
.
Vertex
)
VertexUniform
vertexUniform
;
@
uniform
@
binding
(1)
@
stage
(
ShaderStage
.
Fragment
)
FragmentUniform
fragmentUniform
;
mixin
MaxObjects
!(
10
)
;
mixin
Instance
;
}
Members
Mixins
__anonymous
mixin
RenderPass
!(
StandardRenderPass
)
Undocumented in source.
__anonymous
mixin
ShaderSource
!(
ShaderStage
.
Vertex
,
q{
#version
450
layout
(
location
=
0
)
in
vec3
position
;
layout
(
location
=
1
)
in
vec2
uv
;
layout
(
location
=
0
)
out
vec2
uv2
;
layout
(
binding
=
0
)
uniform
UniformData
{
mat4
worldMatrix
;
mat4
viewMatrix
;
mat4
projectionMatrix
; }
uni
;
void
main
() {
gl_Position
=
uni
.
projectionMatrix
*
uni
.
viewMatrix
*
uni
.
worldMatrix
*
vec4
(
position
,
1
);
gl_Position
.
y
= -
gl_Position
.
y
;
uv2
=
uv
; }
}
)
Undocumented in source.
__anonymous
mixin
ShaderSource
!(
ShaderStage
.
Fragment
,
q{
#version
450
layout
(
location
=
0
)
in
vec2
uv
;
layout
(
location
=
0
)
out
vec4
fragColor
;
layout
(
binding
=
1
)
uniform
UniformData
{
vec2
tileSize
; }
uni
;
void
main
() {
vec2
po
=
mod
(
uv
/
uni
.
tileSize
,
2
);
int
x
=
po
.
x
<
1
?
0
:
1
;
int
y
=
po
.
y
<
1
?
0
:
1
;
if
(
x
+
y
==
0
) {
fragColor
=
vec4
(
vec3
(
0.1
),
1
); }
if
(
x
+
y
==
1
) {
fragColor
=
vec4
(
vec3
(
0.2
),
1
); }
else
{
fragColor
=
vec4
(
vec3
(
0.3
),
1
); } }
}
)
Undocumented in source.
__anonymous
mixin
Info
!
i
Undocumented in source.
__anonymous
mixin
MaxObjects
!(
10
)
Undocumented in source.
__anonymous
mixin
Instance
Undocumented in source.
Structs
FragmentUniform
struct
FragmentUniform
Undocumented in source.
Vertex
struct
Vertex
Undocumented in source.
VertexUniform
struct
VertexUniform
Undocumented in source.
Variables
fragmentUniform
FragmentUniform
fragmentUniform
;
Undocumented in source.
i
CreateInfo
i
;
Undocumented in source.
vertexUniform
VertexUniform
vertexUniform
;
Undocumented in source.
Inherited Members
From Material
__anonymous
mixin
Descriptor
Undocumented in source.
pipelineLayout
PipelineLayout
pipelineLayout
;
Undocumented in source.
pipeline
Pipeline
pipeline
;
Undocumented in source.
__anonymous
mixin
ImplReleaseOwn
Undocumented in source.
CreateInfo
struct
CreateInfo
Undocumented in source.
Info
mixintemplate
Info
(CreateInfo info_)
Undocumented in source.
RenderPass
mixintemplate
RenderPass
(RenderPassType_)
Undocumented in source.
Instance
mixintemplate
Instance
()
Undocumented in source.
createVertexAttributeDescriptions
VkVertexInputAttributeDescription
[]
createVertexAttributeDescriptions
(uint binding)
Undocumented in source. Be warned that the author may not have intended to support it.
getFormat
template
getFormat
(Type)
Undocumented in source.
vertexInputState
Pipeline
.
VertexInputStateCreateInfo
vertexInputState
()
Undocumented in source. Be warned that the author may not have intended to support it.
Meta
Source
See Implementation
sbylib
graphics
material
standard
unrealfloor
classes
UnrealFloorMaterial