renderer

package
v0.0.0-...-585686a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package renderer implements the scene renderer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgSpecs

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

type Renderer

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

func NewRenderer

func NewRenderer(gs *gls.GLS) *Renderer

func (*Renderer) AddChunk

func (r *Renderer) AddChunk(name, source string) error

func (*Renderer) AddDefaultShaders

func (r *Renderer) AddDefaultShaders() error

func (*Renderer) AddProgram

func (r *Renderer) AddProgram(name, vertex, frag string) error

func (*Renderer) AddShader

func (r *Renderer) AddShader(name, source string) error

func (*Renderer) Render

func (r *Renderer) Render(iscene core.INode, icam camera.ICamera) error

type ShaderSpecs

type ShaderSpecs struct {
	Name             string // Shader name
	Version          string // GLSL version
	UseLights        material.UseLights
	AmbientLightsMax int // Current number of ambient lights
	DirLightsMax     int // Current Number of directional lights
	PointLightsMax   int // Current Number of point lights
	SpotLightsMax    int // Current Number of spot lights
	MatTexturesMax   int // Current Number of material textures
}

func (*ShaderSpecs) Compare

func (ss *ShaderSpecs) Compare(other *ShaderSpecs) bool

type Shaman

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

func NewShaman

func NewShaman(gs *gls.GLS) *Shaman

NewShaman creates and returns a pointer to a new shader manager

func (*Shaman) AddChunk

func (sm *Shaman) AddChunk(name, source string) error

func (*Shaman) AddDefaultShaders

func (sm *Shaman) AddDefaultShaders() error

func (*Shaman) AddProgram

func (sm *Shaman) AddProgram(name, vertexName, fragName string) error

func (*Shaman) AddShader

func (sm *Shaman) AddShader(name, source string) error

func (*Shaman) GenProgram

func (sm *Shaman) GenProgram(specs *ShaderSpecs) (*gls.Program, error)

Generates shader program from the specified specs

func (*Shaman) Init

func (sm *Shaman) Init(gs *gls.GLS)

func (*Shaman) SetProgram

func (sm *Shaman) SetProgram(specs *ShaderSpecs) (bool, error)

SetShader set the shader to satify the specified specs Returns an indication if the current shader has changed and an error

Directories

Path Synopsis
Package shader contains the several shaders used by the engine.
Package shader contains the several shaders used by the engine.

Jump to

Keyboard shortcuts

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