poly

package
v0.0.0-...-d322e89 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2018 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package poly will provide a 3D renderer to display polygonal art (aka low-poly).

Note: the rendrer is not yet functional.

Index

Constants

This section is empty.

Variables

View Source
var (
	Gold      = color.LRGB{1.000000, 0.765557, 0.336057}
	Silver    = color.LRGB{0.971519, 0.959915, 0.915324}
	Aluminium = color.LRGB{0.913183, 0.921494, 0.924524}
	Copper    = color.LRGB{0.955008, 0.637427, 0.538163}
	Chromium  = color.LRGB{0.549585, 0.556114, 0.554256}
	Nickel    = color.LRGB{0.659777, 0.608679, 0.525649}
	Titanium  = color.LRGB{0.541931, 0.496791, 0.449419}
	Cobalt    = color.LRGB{0.662124, 0.654864, 0.633732}
	Platinum  = color.LRGB{0.672411, 0.637331, 0.585456}
	Iron      = color.LRGB{0.560, 0.570, 0.580}
)

Functions

func BindMaterialBuffer

func BindMaterialBuffer()

func BindMeshBuffers

func BindMeshBuffers()

func DeleteMaterialBuffer

func DeleteMaterialBuffer()

func DeleteMeshBuffers

func DeleteMeshBuffers()

func DirectionalLightSpectralIlluminance

func DirectionalLightSpectralIlluminance(illuminance, temperature float64) color.LRGB

func Err

func Err() error

Err returns the first unchecked error of the package since last call to the function. The error is then considered checked, and further calls to Err will return nil until the next error occurs.

Note: errors occuring while there already is an unchecked error will not be recorded. However, if the debug mode is active, all errors will be logged.

func PipelineSetup

func PipelineSetup() gl.PipelineConfig

func SetupMaterialBuffer

func SetupMaterialBuffer(p []Material) error

func SetupMeshBuffers

func SetupMeshBuffers(m Meshes) error

func TemperatureColor

func TemperatureColor(temperature float64) color.LRGB

func ToneMapACES

func ToneMapACES() gl.PipelineConfig

ToneMapACES provides a fragment shader function to apply tone mapping at the end of the pipeline. In order to use it, add the following declaration in your fragment shader:

vec3 glam_ToneMap(vec3 Color);

func ToneMapHable

func ToneMapHable() gl.PipelineConfig

ToneMapHable provides a fragment shader function to apply tone mapping at the end of the pipeline. In order to use it, add the following declaration in your fragment shader:

vec3 glam_ToneMap(vec3 Color);

func ToneMapHejl

func ToneMapHejl() gl.PipelineConfig

ToneMapHejl provides a fragment shader function to apply tone mapping at the end of the pipeline. In order to use it, add the following declaration in your fragment shader:

vec3 glam_ToneMap(vec3 Color);

func ToneMapReinhardt

func ToneMapReinhardt() gl.PipelineConfig

ToneMapReinhardt provides a fragment shader function to apply tone mapping at the end of the pipeline. In order to use it, add the following declaration in your fragment shader:

vec3 glam_ToneMap(vec3 Color);

func ToneMapSimpleACES

func ToneMapSimpleACES() gl.PipelineConfig

ToneMapSimpleACES provides a fragment shader function to apply tone mapping at the end of the pipeline. In order to use it, add the following declaration in your fragment shader:

vec3 glam_ToneMap(vec3 Color);

Types

type Face

type Face struct {
	MathiVert0Vert1 uint32
	MatloVert2Vert3 uint32
}

func (*Face) MakeFace

func (f *Face) MakeFace(material byte, a, b, c, d uint32)

type Instance

type Instance struct {
	BaseVertex uint32 `layout:"1"`
	// contains filtered or unexported fields
}

type Material

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

type MeshID

type MeshID struct {
	FaceID   uint32
	VertexID uint32
}

type Meshes

type Meshes struct {
	Faces    []Face
	Vertices []coord.XYZ
}

func (*Meshes) AddObj

func (m *Meshes) AddObj(filename string) (MeshID, error)

type PlanarCamera

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

A PlanarCamera is a camera designed to move on a plane. Rotation is locked around the "up" axis.

func NewPlanarCamera

func NewPlanarCamera() *PlanarCamera

NewPlanarCamera returns a new camera.

func (*PlanarCamera) Bind

func (c *PlanarCamera) Bind()

func (*PlanarCamera) ChangeDistance

func (c *PlanarCamera) ChangeDistance(d float32)

func (*PlanarCamera) Distance

func (c *PlanarCamera) Distance() float32

func (*PlanarCamera) Focus

func (c *PlanarCamera) Focus() coord.XYZ

func (*PlanarCamera) Move

func (c *PlanarCamera) Move(forward, lateral, vertical float32)

func (*PlanarCamera) Orientation

func (c *PlanarCamera) Orientation() (yaw, pitch, roll float32)

func (*PlanarCamera) Rotate

func (c *PlanarCamera) Rotate(yaw, pitch, roll float32)

func (*PlanarCamera) SetDistance

func (c *PlanarCamera) SetDistance(d float32)

func (*PlanarCamera) SetExposure

func (c *PlanarCamera) SetExposure(aperture, shutterTime, sensitivity float64)

func (*PlanarCamera) SetFieldOfView

func (c *PlanarCamera) SetFieldOfView(fov float32, near, far float32)

func (*PlanarCamera) SetFocus

func (c *PlanarCamera) SetFocus(p coord.XYZ)

func (*PlanarCamera) SetOrientation

func (c *PlanarCamera) SetOrientation(yaw, pitch, roll float32)

func (*PlanarCamera) View

func (c *PlanarCamera) View() space.Matrix

func (*PlanarCamera) WindowResized

func (c *PlanarCamera) WindowResized()

Jump to

Keyboard shortcuts

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