Documentation
¶
Overview ¶
Package Sky provides a sky shader pipeline used for shading 3D objects.
Index ¶
- type Light
- type Lighting
- type RenderMode
- type Shader
- func (*Shader[T]) Fragment(state struct{}) struct{}
- func (*Shader[T]) Lighting(Snapshot) Lighting
- func (*Shader[T]) Material(state struct{}) Snapshot
- func (s *Shader[T]) OnCreate(value reflect.Value)
- func (*Shader[T]) Pipeline() [3]string
- func (*Shader[T]) RenderMode() []RenderMode
- func (*Shader[T]) ShaderType() string
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Light ¶
type Light struct { Enabled bool.X // true if LIGHTX is visible and in the scene. If false, other light properties may be garbage. Energy float.X // Energy multiplier for LIGHTX. Direction vec3.XYZ // Direction that LIGHTX is facing. Color vec3.RGB // Color of LIGHTX. Size float.X // Angular diameter of LIGHTX in the sky. Expressed in radians. For reference, the sun from earth is about .0087 radians (0.5 degrees). }
type RenderMode ¶
type RenderMode string
const ( UseHalfResPass RenderMode = "use_half_res_pass" // Allows the shader to write to and access the half resolution pass. UseQuarterResPass RenderMode = "use_quarter_res_pass" // Allows the shader to write to and access the quarter resolution pass. DisableFog RenderMode = "disable_fog" // If used, fog will not affect the sky. )
type Shader ¶
type Shader[T gdclass.Interface] struct { ShaderMaterial.Extension[T] }
func (*Shader[T]) RenderMode ¶
func (*Shader[T]) RenderMode() []RenderMode
func (*Shader[T]) ShaderType ¶
type Snapshot ¶
type Snapshot struct { CameraPosition vec3.XYZ `gd:"POSITION"` // Camera position in world space. Radiance texture.CubeSampler[vec4.RGBA] `gd:"RADIANCE"` // Radiance cubemap. Can only be read from during background pass. Check !AT_CUBEMAP_PASS before using. AtHalfResPass bool.X `gd:"AT_HALF_RES_PASS"` // True if the shader is being processed at half resolution pass. AtQuarterResPass bool.X `gd:"AT_QUARTER_RES_PASS"` // True if the shader is being processed at quarter resolution pass. AtCubemapPass bool.X `gd:"AT_CUBEMAP_PASS"` // True if the shader is being processed at cubemap pass. EyeDirection vec3.XYZ `gd:"EYE_DIRECTION"` // Normalized direction of current pixel. Use this as your basic direction for procedural effects. ScreenUV vec2.XY `gd:"SCREEN_UV"` // Screen UV coordinate for current pixel. Used to map a texture to the full screen. SkyCoords vec2.XY `gd:"SKY_COORDS"` // Sphere UV. Used to map a panorama texture to the sky. HalfResColor vec4.RGBA `gd:"HALF_RES_COLOR"` // Color value of corresponding pixel from half resolution pass. Uses linear filter. QuarterResColor vec4.RGBA `gd:"QUARTER_RES_COLOR"` // Color value of corresponding pixel from quarter resolution pass. Uses linear filter. }
Click to show internal directories.
Click to hide internal directories.