Skip to content

atl/sm/render

import "atl/sm/render"

Render setting overrides (sm.render). Mostly [client]; each Reset* restores the default.

func DefaultFog() atl.Value
func DefaultVolumetricFog() atl.Value
func DefaultGI() atl.Value
func DefaultHorizonLight() atl.Value
func DefaultCameraLight() atl.Value
func DefaultReflectionColor() atl.Value
func DefaultVoxelLODBoost() float64

The default settings, as tables of the matching Set* arguments.

func DrawDistance() float64

The view distance.

func IsOutdoor() bool

True when the camera is outdoors.

func OutdoorLighting() float64

The day/night lighting fraction.

func SetOutdoorLighting(v float64)

Overrides the day/night lighting fraction.

func SetCinematic(cinematic bool)

Turns the cinematic render mode on or off.

func SetFog(f Fog)

Overrides the fog.

func ResetFog()

Restores the default fog.

func SetVolumetricFog(min, max, loopSpeed float64, scrollSpeed, scale sm.Vec3, intensity float64)

Overrides the volumetric fog.

func ResetVolumetricFog()

Restores the default volumetric fog.

func SetGI(weight float64)

Overrides the global illumination weight.

func ResetGI()

Restores the default global illumination.

func SetHorizonLight(top, horizon, bottom sm.Color, direction sm.Vec3, startDistance, endDistance,
falloff float64)

Overrides the sky's horizon light.

func ResetHorizonLight()

Restores the default horizon light.

func SetCameraLight(l CameraLight)

Overrides the camera light.

func ResetCameraLight()

Restores the default camera light.

func SetLUT(a string, b *string, blend *float64)

Color grading: blends LUT texture a toward b.

func ResetLUT()

Restores the default color grading.

func SetReflectionLevelColor(level string, min, max, mul float64)

Overrides the reflection color of one level.

func ResetAllReflectionColor()

Restores every reflection color.

func SetVoxelLODBoost(boost float64)
func ResetVoxelLODBoost()

Overrides / restores the voxel terrain level-of-detail boost.

func SetClouds(c Clouds)

Overrides the clouds.

type ScreenPoint struct {
X, Y float64
}

A point in screen pixels.

func ToScreen(world sm.Vec3, width, height int) ScreenPoint

Where world appears on a screen of width x height pixels.

type Fog struct {
StartDistance, EndDistance, Falloff float64
StartColor, EndColor sm.Color
VerticalOpacity, VerticalFadeDistance, VerticalFalloff, VerticalStart, VerticalEnd float64
VerticalStartColor, VerticalEndColor sm.Color
FadeDistance float64
}

Distance and height fog settings.

type CameraLight struct {
Intensity, Range float64
Color sm.Color
FarIntensity, FarRange *float64
FarColor *sm.Color
}

The light that follows the camera, with optional far values.

type Clouds struct {
Coverage, Height, Radius, TallnessScale, DirectionalLightMod float64
Scroll, ScrollRotation sm.Vec3
}

Cloud settings.