sbylib ~master (2020-02-29T08:12:18Z)
Dub
Repo
NormalMaterial
sbylib
graphics
material
standard
normal
Undocumented in source.
class
NormalMaterial :
Material
{
mixin
RenderPass
!(
StandardRenderPass
)
;
mixin
ShaderSource
!(
ShaderStage
.
Vertex
,
q{
#version
450
layout
(
location
=
0
)
in
vec3
position
;
layout
(
location
=
1
)
in
vec3
normal
;
layout
(
location
=
0
)
out
vec3
outNormal
;
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
;
outNormal
=
normal
; }
}
)
;
mixin
ShaderSource
!(
ShaderStage
.
Fragment
,
q{
#version
450
layout
(
location
=
0
)
in
vec3
normal
;
layout
(
location
=
0
)
out
vec4
fragColor
;
void
main
() {
fragColor
=
vec4
(
normalize
(
normal
)*
.5
+
.5
,
1
); }
}
)
;
struct
Vertex
;
immutable
CreateInfo
i
;
mixin
Info
!
i
;
struct
VertexUniform
;
@
uniform
@
binding
(0)
@
stage
(
ShaderStage
.
Vertex
)
VertexUniform
vertexUniform
;
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
vec3
normal
;
layout
(
location
=
0
)
out
vec3
outNormal
;
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
;
outNormal
=
normal
; }
}
)
Undocumented in source.
__anonymous
mixin
ShaderSource
!(
ShaderStage
.
Fragment
,
q{
#version
450
layout
(
location
=
0
)
in
vec3
normal
;
layout
(
location
=
0
)
out
vec4
fragColor
;
void
main
() {
fragColor
=
vec4
(
normalize
(
normal
)*
.5
+
.5
,
1
); }
}
)
Undocumented in source.
__anonymous
mixin
Info
!
i
Undocumented in source.
__anonymous
mixin
Instance
Undocumented in source.
__anonymous
mixin
MaxObjects
!(
10
)
Undocumented in source.
Structs
Vertex
struct
Vertex
Undocumented in source.
VertexUniform
struct
VertexUniform
Undocumented in source.
Variables
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
normal
classes
NormalMaterial