Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DiffuseFragmentShader string
View Source
var DiffuseShader = ShaderConfig{ VertexShader: DiffuseVertexShader, FragmentShader: DiffuseFragmentShader, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("normalIn", AttrVec3, NormalXYZ), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"view", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"viewPos", AttrVec3}, Attr{"material.ambient", AttrVec3}, Attr{"material.diffuse", AttrVec3}, Attr{"material.specular", AttrVec3}, Attr{"material.shininess", AttrFloat}, Attr{"dirLight.direction", AttrVec3}, Attr{"dirLight.ambient", AttrVec3}, Attr{"dirLight.diffuse", AttrVec3}, Attr{"dirLight.specular", AttrVec3}, }, }
View Source
var DiffuseVertexShader string
View Source
var MSDFFragmentShader string
View Source
var MSDFShader = ShaderConfig{ VertexShader: SpriteVertexShader, FragmentShader: MSDFFragmentShader, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("colorIn", AttrVec4, ColorRGBA), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"view", AttrMat4}, Attr{"u_threshold", AttrFloat}, Attr{"u_outline_width_relative", AttrFloat}, Attr{"u_outline_blur", AttrFloat}, Attr{"u_outline_color", AttrVec4}, }, }
View Source
var MinimapFragmentShader string
View Source
var MinimapShader = ShaderConfig{ VertexShader: SpriteVertexShader, FragmentShader: MinimapFragmentShader, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("colorIn", AttrVec4, ColorRGBA), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"view", AttrMat4}, }, }
View Source
var PixelArtFrag string
View Source
var PixelArtShader = ShaderConfig{ VertexShader: PixelArtVert, FragmentShader: SubPixelAntiAliased, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("colorIn", AttrVec4, ColorRGBA), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"view", AttrMat4}, Attr{"texelsPerPixel", AttrFloat}, }, }
View Source
var PixelArtShader2 = ShaderConfig{ VertexShader: PixelArtVert, FragmentShader: PixelArtFrag, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("colorIn", AttrVec4, ColorRGBA), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"view", AttrMat4}, }, }
View Source
var PixelArtVert string
View Source
var SDFFragmentShader string
View Source
var SDFShader = ShaderConfig{ VertexShader: SpriteVertexShader, FragmentShader: SDFFragmentShader, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("colorIn", AttrVec4, ColorRGBA), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"view", AttrMat4}, }, }
View Source
var SpriteFragmentShader string
View Source
var SpriteShader = ShaderConfig{ VertexShader: SpriteVertexShader, FragmentShader: SpriteFragmentShader, VertexFormat: VertexFormat{ VertexAttribute("positionIn", AttrVec3, PositionXYZ), VertexAttribute("colorIn", AttrVec4, ColorRGBA), VertexAttribute("texCoordIn", AttrVec2, TexCoordXY), }, UniformFormat: UniformFormat{ Attr{"model", AttrMat4}, Attr{"projection", AttrMat4}, Attr{"view", AttrMat4}, }, }
View Source
var SpriteVertexShader string
View Source
var SubPixelAntiAliased string
Functions ¶
This section is empty.
Types ¶
type AttrType ¶
type AttrType uint8
This type is used to define the underlying data type of a vertex attribute or uniform attribute
type ShaderConfig ¶
type ShaderConfig struct {
VertexShader, FragmentShader string
VertexFormat VertexFormat
UniformFormat UniformFormat
}
type SwizzleType ¶
type SwizzleType uint8
This type is used to define how generic meshes map into specific shader buffers
const ( PositionXY SwizzleType = iota PositionXYZ NormalXY NormalXYZ ColorR ColorRG ColorRGB ColorRGBA TexCoordXY )
type UniformFormat ¶
type UniformFormat []Attr
type VertexAttr ¶
type VertexAttr struct { Attr // The underlying Attribute Swizzle SwizzleType // This defines how the shader wants to map a generic object (like a mesh, to the shader buffers) }
func VertexAttribute ¶
func VertexAttribute(name string, Type AttrType, swizzle SwizzleType) VertexAttr
type VertexFormat ¶
type VertexFormat []VertexAttr
TODO - right now we only support floats (for simplicity)
Click to show internal directories.
Click to hide internal directories.