options

package
v0.0.0-...-3626a0a Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AntiAlias

type AntiAlias struct {
	MaxDivisions int     `` /* 215-byte string literal not displayed */
	Threshold    float64 `` /* 189-byte string literal not displayed */
}

AntiAlias defines the anti-alias options.

type Background

type Background struct {
	Type  string `title:"Type of background" choice:"Uniform,Skybox,Photosphere" json:"type"`
	Color Color  `title:"Color to use for a solid background (Uniform)" json:"color"`
	Image string `title:"Path/URL of image to use (Skybox, Photosphere)" class:"fast-render" json:"image"`
}

Background defines the options for rays that don't hit objects.

type Camera

type Camera struct {
	Position Vector  `title:"Camera position" json:"position"`
	LookAt   Vector  `title:"The point that the camera is looking at" json:"look_at"`
	UpDir    Vector  `title:"The up direction" json:"up_dir"`
	Fov      float64 `title:"Field of view in degrees" min:"0.1" max:"360.0" json:"fov"`
	Dof      Dof     `title:"Depth of field" json:"dof"`
}

Camera defines the camera position and other options.

type Color

type Color struct {
	R float64 `min:"0.0" max:"1.0" step:"0.1" default:"0.0" json:"r"`
	G float64 `min:"0.0" max:"1.0" step:"0.1" default:"0.0" json:"g"`
	B float64 `min:"0.0" max:"1.0" step:"0.1" default:"0.0" json:"b"`
}

Color is and RGB color.

type Debug

type Debug struct {
	Enabled     bool   `title:"Produce a debug image" json:"enabled"`
	Type        string `title:"Type of debug image to produce" choice:"Ray Count,Anti Alias Subdivisions,Singe Pixel" json:"type"`
	Scale       int    `title:"Number of rays to reach white" min:"1" json:"scale"`
	SinglePixel bool   `title:"Render one pixel" json:"single_pixel"`
	Pixel       Pixel  `title:"Pixel to render" json:"pixel"`
}

Debug defines special options for producing images for debugging.

type Dof

type Dof struct {
	Enabled           bool    `title:"Enable depth of field. Enabling DOF will increase rendering time." class:"fast-render" json:"enabled"`
	FocalDistance     float64 `title:"Distance from the camera of the focal point" min:"0.01" max:"999.9" json:"focal_distance"`
	ApertureRadius    float64 `title:"Radius of the aperture" min:"0.00001" max:"999.9" json:"aperture_radius"`
	MaxRays           int     `title:"Maximum DOF rays to cast per pixel" min:"1" json:"max_rays"`
	AdaptiveThreshold float64 `` /* 268-byte string literal not displayed */
}

Dof defines the depth of field options.

type Global

type Global struct {
	FastRender        bool    `title:"Disable/limit some settings in order to decrease rendering time" id:"fast-render" json:"fast_render"`
	MaxRecursion      int     `` /* 162-byte string literal not displayed */
	AdaptiveThreshold float64 `` /* 252-byte string literal not displayed */
	SoftShadowDetail  int     `` /* 167-byte string literal not displayed */
}

Global contains global options.

type Layout

type Layout struct {
	Name      string    `title:"Name of existing object from the list of objects" json:"name"`
	Transform Transform `title:"Tranform of the object" json:"transform"`
}

Layout defines transform options for an object.

type Light

type Light struct {
	Type            string `title:"Type of light" choice:"Directional,Point,Spot" json:"type"`
	Color           Color  `title:"Color of the light" json:"color"`
	Position        Vector `title:"Position of the light (Point and Spot)" json:"position"`
	Direction       Vector `title:"Direction of the light (Direcitonal and Spot)" json:"direction"`
	IlluminationMap bool   `title:"Generate an illumination map (Spot). Increases rendering time." class:"fast-render" json:"illumination_map"`
	Coeff           struct {
		Constant  float64 `json:"constant"`
		Linear    float64 `json:"linear"`
		Quadratic float64 `json:"quadratic"`
	} `title:"Constant, lnear, and quadratic coefficients for point light fall off (Point and Spot)" json:"coeff"`
	Angle     float64 `title:"Spotlight angle (Spot)" min:"0.0" max:"360.0" json:"angle"`
	DropOff   float64 `title:"Spotlight drop off angle (Spot)" min:"0.0" max:"360.0" json:"drop_off"`
	FadeAngle float64 `title:"Stoplight fade angle (Spot)" min:"0.0" max:"360.0" json:"fade_angle"`
}

Light defines options for single light source.

type MatProperty

type MatProperty struct {
	Type    string  `title:"Type of material" choice:"Uniform,Texture" json:"type"`
	Color   Color   `title:"Uniform color" json:"color"`
	Texture Texture `title:"Texture options if using the 'Texture' type" class:"fast-render" json:"texture"`
}

MatProperty defines the properties of a single material option.

type Material

type Material struct {
	Name         string      `title:"Unique name for this material" json:"name"`
	Emissive     MatProperty `title:"Emissive color of the material" json:"emissive"`
	Ambient      MatProperty `title:"Abmient color of the material" json:"ambient"`
	Diffuse      MatProperty `title:"Diffuse color of the material" json:"diffuse"`
	Specular     MatProperty `title:"Specular color of the material" json:"specular"`
	Reflective   MatProperty `title:"Reflectivness of the material" json:"reflective"`
	Transmissive MatProperty `title:"Transmissivness of the material" json:"transmissive"`
	Smoothness   MatProperty `title:"Smoothness of the material. Affects size of speclar spots" json:"smoothness"`
	Index        float64     `title:"Refractive index of the material" step:"0.1" json:"index"`
	Normal       string      `title:"Path/URL of image to use as a normal map" json:"normal"`
	IsLiquid     bool        `title:"Overlapping behavior is only defined for non-liquids inside liquids" json:"is_liquid"`
	Brdf         string      `title:"Shadding algorithm" choice:"Lambert,Blinn-Phong" json:"brdf"`
}

Material defines options for materials.

type Object

type Object struct {
	Name         string    `title:"Name of new or existing object" json:"name"`
	Type         string    `` /* 138-byte string literal not displayed */
	Transform    Transform `title:"Tranform of the object" json:"transform"`
	Material     string    `title:"Name of the material to use" json:"material"`
	TopRadius    float64   `title:"Top radius for cone objects" step:"0.1" json:"top_radius"`
	BottomRadius float64   `title:"Bottom radius for cone objects" step:"0.1" json:"bottom_radius"`
	Capped       bool      `title:"Whether to cap the ends of cones/cylinders" json:"capped"`
	Children     []*Object `title:"Child objects that inherit this one's transform" json:"children"`
}

Object definse options for a single object.

type Options

type Options struct {
	Global     Global      `title:"Global options" json:"global"`
	Resolution Resolution  `title:"Image width and height in pixels. Larger resolution will increase rendering time." json:"resolution"`
	Background Background  `title:"Determines the color when a ray doesn't hit anything" json:"background"`
	Camera     Camera      `title:"Camera position and orientation" json:"camera"`
	AntiAlias  AntiAlias   `title:"Anti-aliasing settings" json:"anti_alias"`
	Debug      Debug       `title:"Debug options" json:"debug"`
	Lights     []*Light    `title:"List of all lights in the scene" json:"lights"`
	Materials  []*Material `title:"List of all the materials available to objects" json:"materials"`
	Objects    []*Object   `title:"List of all objects in the scene" json:"objects"`
	Layout     []*Layout   `title:"Placement of objects" json:"layout"`
}

Options contains all the options possible.

func NewOptions

func NewOptions() *Options

NewOptions returns an intialized Options.

type Pixel

type Pixel struct {
	X int `title:"X value of the pixel" min:"0" valid:"validXPixel" json:"x"`
	Y int `title:"Y value of the pixel" min:"0" valid:"validYPixel" json:"y"`
}

Pixel specifies a single pixel.

type Resolution

type Resolution struct {
	W int `title:"Width in pixels. Larger values increase rendering time." min:"1" max:"16000" json:"w"`
	H int `title:"Height in pixels. Larger values increase rendering time." min:"1" max:"16000" json:"h"`
}

Resolution defines the dimensions of the image.

type Rotate

type Rotate struct {
	Axis  Vector  `title:"Axis to rotate around" json:"rotate_axis"`
	Angle float64 `title:"Angle to rotate around the axis in degrees" min:"-360.0" max:"360.0" json:"rotate_angle"`
}

Rotate specfies a rotation axis and angle

type Texture

type Texture struct {
	Source  string  `title:"Path to texture file" json:"source"`
	ScaleX  float64 `title:"Scale of the texture in the X direction. Note that 0 is equivalent to 1." min:"0.0" step:"0.1" json:"scale_x"`
	ScaleY  float64 `title:"Scale of the texture in the Y direction. Note that 0 is equivalent to 1." min:"0.0" step:"0.1" json:"scale_y"`
	OffsetX float64 `title:"Offset of the texture in the X direction" step:"0.1" json:"offset_x"`
	OffsetY float64 `title:"Offset of the texture in the Y direction" step:"0.1" json:"offset_y"`
	Tile    bool    `title:"Whether or not to tile the texture" json:"tile"`
}

Texture defines options for a texture.

type Transform

type Transform struct {
	Translate Vector   `title:"Translation" json:"translate"`
	Rotate    []Rotate `title:"Each rotation is applied in order" json:"rotate"`
	Scale     Vector   `title:"Scale" json:"scale"`
}

Transform defines the transform for an object.

type Vector

type Vector struct {
	X float64 `min:"-999" max:"999" default:"0.0" json:"x"`
	Y float64 `min:"-999" max:"999" default:"0.0" json:"y"`
	Z float64 `min:"-999" max:"999" default:"0.0" json:"z"`
}

Vector is a 3D vector.

Jump to

Keyboard shortcuts

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