internal

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoordAttributeIndex    = 0
	NormalAttributeIndex   = 1
	TangentAttributeIndex  = 2
	TexCoordAttributeIndex = 3
	ColorAttributeIndex    = 4
	WeightsAttributeIndex  = 5
	JointsAttributeIndex   = 6
)
View Source
const (
	UniformBufferBindingCamera      = 0
	UniformBufferBindingModel       = 1
	UniformBufferBindingMaterial    = 2
	UniformBufferBindingArmature    = 3
	UniformBufferBindingLight       = 4
	UniformBufferBindingPostprocess = 6
	UniformBufferBindingBloom       = 7
)
View Source
const (
	TextureBindingGeometryAlbedoTexture = 0

	TextureBindingLightingFramebufferColor0 = 0
	TextureBindingLightingFramebufferColor1 = 1
	TextureBindingLightingFramebufferDepth  = 3
	TextureBindingLightingReflectionTexture = 4
	TextureBindingLightingRefractionTexture = 5

	TextureBindingLightingShadowMap = 4

	TextureBindingPostprocessFramebufferColor0 = 0
	TextureBindingPostprocessBloom             = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArmatureUniform added in v0.19.0

type ArmatureUniform struct {
	BoneMatrices []byte
}

func (ArmatureUniform) Std140Plot added in v0.19.0

func (u ArmatureUniform) Std140Plot(plotter *blob.Plotter)

func (ArmatureUniform) Std140Size added in v0.19.0

func (u ArmatureUniform) Std140Size() uint32

type BloomBlurUniform added in v0.19.0

type BloomBlurUniform struct {
	Horizontal float32
}

func (BloomBlurUniform) Std140Plot added in v0.19.0

func (u BloomBlurUniform) Std140Plot(plotter *blob.Plotter)

func (BloomBlurUniform) Std140Size added in v0.19.0

func (u BloomBlurUniform) Std140Size() uint32

type CameraUniform added in v0.17.0

type CameraUniform struct {
	ProjectionMatrix sprec.Mat4
	ViewMatrix       sprec.Mat4
	CameraMatrix     sprec.Mat4
	Viewport         sprec.Vec4
	Time             float32
}

func (CameraUniform) Std140Plot added in v0.17.0

func (u CameraUniform) Std140Plot(plotter *blob.Plotter)

func (CameraUniform) Std140Size added in v0.17.0

func (u CameraUniform) Std140Size() uint32

type DirectionalShadowMap added in v0.20.0

type DirectionalShadowMap struct {
	ArrayTexture render.Texture
	Cascades     []DirectionalShadowMapCascade
}

type DirectionalShadowMapCascade added in v0.20.0

type DirectionalShadowMapCascade struct {
	Framebuffer      render.Framebuffer
	ProjectionMatrix sprec.Mat4
	Near             float32
	Far              float32
}

type DirectionalShadowMapRef added in v0.20.0

type DirectionalShadowMapRef struct {
	DirectionalShadowMap
}

type LightUniform added in v0.17.0

type LightUniform struct {
	ShadowMatrices [4]sprec.Mat4
	ModelMatrix    sprec.Mat4

	ShadowCascades [4]sprec.Vec2

	Color     sprec.Vec3
	Intensity float32

	Range      float32
	OuterAngle float32
	InnerAngle float32
}

func (LightUniform) Std140Plot added in v0.17.0

func (u LightUniform) Std140Plot(plotter *blob.Plotter)

func (LightUniform) Std140Size added in v0.17.0

func (u LightUniform) Std140Size() uint32

type MaterialRenderPass added in v0.19.0

type MaterialRenderPass struct {
	Layer           int32
	Culling         render.CullMode
	FrontFace       render.FaceOrientation
	DepthTest       bool
	DepthWrite      bool
	DepthComparison render.Comparison
	Blending        bool
	TextureSet      TextureSet
	UniformSet      UniformSet
	// TODO: Add blending
	Shader *lsl.Shader
}

type MaterialUniform added in v0.17.0

type MaterialUniform struct {
	Data []byte
}

func (MaterialUniform) Std140Plot added in v0.17.0

func (u MaterialUniform) Std140Plot(plotter *blob.Plotter)

func (MaterialUniform) Std140Size added in v0.17.0

func (u MaterialUniform) Std140Size() uint32

type MeshRenderPass added in v0.19.0

type MeshRenderPass struct {
	Layer           int32
	Program         render.Program
	Pipeline        render.Pipeline
	IndexByteOffset uint32
	IndexCount      uint32

	Key        uint32
	TextureSet TextureSet
	UniformSet UniformSet
}

type MeshRenderPassType added in v0.19.0

type MeshRenderPassType uint8
const (
	MeshRenderPassTypeShadow MeshRenderPassType = iota
	MeshRenderPassTypeGeometry
	MeshRenderPassTypeForward
	MeshRenderPassTypeSky
	MeshRenderPassTypePostprocess
	MeshRenderPassTypeCount
)

type ModelUniform added in v0.17.0

type ModelUniform struct {
	ModelMatrices []byte
}

func (ModelUniform) Std140Plot added in v0.17.0

func (u ModelUniform) Std140Plot(plotter *blob.Plotter)

func (ModelUniform) Std140Size added in v0.17.0

func (u ModelUniform) Std140Size() uint32

type PointShadowMap added in v0.20.0

type PointShadowMap struct {
	ArrayTexture render.Texture
	Framebuffers [6]render.Framebuffer
}

type PostprocessUniform added in v0.16.0

type PostprocessUniform struct {
	Exposure float32
}

func (PostprocessUniform) Std140Plot added in v0.17.0

func (u PostprocessUniform) Std140Plot(plotter *blob.Plotter)

func (PostprocessUniform) Std140Size added in v0.16.0

func (u PostprocessUniform) Std140Size() uint32

type PropertyKind added in v0.19.0

type PropertyKind uint8
const (
	PropertyKindUnknown PropertyKind = iota
	PropertyKindFloat
	PropertyKindVec2
	PropertyKindVec3
	PropertyKindVec4
)

func ResolvePropertyKind added in v0.19.0

func ResolvePropertyKind(value any) PropertyKind

type RenderPassPipelineInfo added in v0.19.0

type RenderPassPipelineInfo struct {
	Program          render.Program
	MeshVertexArray  render.VertexArray
	FragmentTopology render.Topology
	PassDefinition   MaterialRenderPass
}

type Shader added in v0.19.0

type Shader interface {
	CreateProgramCode(info ShaderProgramCodeInfo) render.ProgramCode
}

type ShaderMeshInfo added in v0.19.0

type ShaderMeshInfo struct {
	MeshHasCoords       bool
	MeshHasNormals      bool
	MeshHasTangents     bool
	MeshHasTextureUVs   bool
	MeshHasVertexColors bool
	MeshHasArmature     bool
}

type ShaderProgramCodeInfo added in v0.19.0

type ShaderProgramCodeInfo struct {
	ShaderMeshInfo
}

type Shape added in v0.9.0

type Shape struct {
	// contains filtered or unexported fields
}

Shape defines a simple 3D mesh that does not have any materials.

func CreateConeShape added in v0.10.0

func CreateConeShape(api render.API) *Shape

func CreateCubeShape added in v0.9.0

func CreateCubeShape(api render.API) *Shape

func CreateQuadShape added in v0.9.0

func CreateQuadShape(api render.API) *Shape

func CreateSphereShape added in v0.10.0

func CreateSphereShape(api render.API) *Shape

func (*Shape) IndexCount added in v0.9.0

func (s *Shape) IndexCount() uint32

IndexCount returns the number of indices that comprise this Shape.

func (*Shape) Release added in v0.9.0

func (s *Shape) Release()

Release releases all resources allocated by this Shape.

func (*Shape) Topology added in v0.9.0

func (s *Shape) Topology() render.Topology

Topology returns the mesh topology of this Shape.

func (*Shape) VertexArray added in v0.9.0

func (s *Shape) VertexArray() render.VertexArray

VertexArray returns the VertexArray that contains the vertices and indices for this Shape.

type SkyLayerDefinition added in v0.19.0

type SkyLayerDefinition struct {
	TextureSet TextureSet
	UniformSet UniformSet

	Program         render.Program
	Pipeline        render.Pipeline
	IndexByteOffset uint32
	IndexCount      uint32
}

func (*SkyLayerDefinition) Delete added in v0.19.0

func (d *SkyLayerDefinition) Delete()

type SkyPipelineInfo added in v0.19.0

type SkyPipelineInfo struct {
	Program  render.Program
	Blending bool
}

type SpotShadowMap added in v0.20.0

type SpotShadowMap struct {
	Texture     render.Texture
	Framebuffer render.Framebuffer
}

type TextureSet added in v0.19.0

type TextureSet struct {
	// contains filtered or unexported fields
}

func NewShaderTextureSet added in v0.19.0

func NewShaderTextureSet(shader *lsl.Shader) TextureSet

func (*TextureSet) Sampler added in v0.19.0

func (t *TextureSet) Sampler(name string) render.Sampler

func (*TextureSet) SamplerAt added in v0.19.0

func (t *TextureSet) SamplerAt(index int) render.Sampler

func (*TextureSet) SetSampler added in v0.19.0

func (t *TextureSet) SetSampler(name string, sampler render.Sampler)

func (*TextureSet) SetTexture added in v0.19.0

func (t *TextureSet) SetTexture(name string, texture render.Texture)

func (*TextureSet) Texture added in v0.19.0

func (t *TextureSet) Texture(name string) render.Texture

func (*TextureSet) TextureAt added in v0.19.0

func (t *TextureSet) TextureAt(index int) render.Texture

func (*TextureSet) TextureCount added in v0.19.0

func (t *TextureSet) TextureCount() int

type UniformProperty added in v0.19.0

type UniformProperty struct {
	// contains filtered or unexported fields
}

type UniformSet added in v0.19.0

type UniformSet struct {
	// contains filtered or unexported fields
}

func NewShaderUniformSet added in v0.19.0

func NewShaderUniformSet(shader *lsl.Shader) UniformSet

func (*UniformSet) Data added in v0.19.0

func (s *UniformSet) Data() []byte

func (*UniformSet) IsEmpty added in v0.19.0

func (s *UniformSet) IsEmpty() bool

func (*UniformSet) Property added in v0.19.0

func (s *UniformSet) Property(name string) any

func (*UniformSet) SetProperty added in v0.19.0

func (s *UniformSet) SetProperty(name string, value any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL