sm.render
Render settings
Functions:
sm.render.getDefaultCameraLight()
Gets a table of the default camera light render settings.
Returns:
| Type | Description |
|---|---|
| table | The default camera light render settings. |
sm.render.getDefaultFog()
Gets a table of the default fog render settings.
Returns:
| Type | Description |
|---|---|
| table | The default fog render settings. |
sm.render.getDefaultGI()
Gets a table of the default GI render settings.
Returns:
| Type | Description |
|---|---|
| table | The default GI render settings. |
sm.render.getDefaultHorizonLight()
Gets a table of the default horizon light render settings.
Returns:
| Type | Description |
|---|---|
| table | The default horizon light render settings. |
sm.render.getDefaultReflectionColor()
Gets a table of the default reflection color render settings.
Returns:
| Type | Description |
|---|---|
| table | The default reflection color render settings. |
sm.render.getDefaultVolumetricFog()
Gets a table of the default Volumetric fog render settings.
Returns:
| Type | Description |
|---|---|
| table | The default Volumetric fog render settings. |
sm.render.getDefaultVoxelLODBoost()
Gets the default voxel LOD boost render setting.
Returns:
| Type | Description |
|---|---|
| number | The default voxel LOD boost render setting. |
sm.render.getDrawDistance()
Client only
Gets the draw distance.
Returns:
| Type | Description |
|---|---|
| number | The draw distance. |
sm.render.getOutdoorLighting()
Client only
Gets the lighting cycle fraction.
Returns:
| Type | Description |
|---|---|
| number | The fraction of the day cycle lighting. |
sm.render.getScreenCoordinatesFromWorldPosition(pos, width, height)
Return the screen coordinates that align with the given world position.
Parameters:
| Type | Name | Description |
|---|---|---|
| Vec3 | pos | World position to align |
| integer | width | Screen width |
| integer | height | Screen height |
Returns:
| Type | Description |
|---|---|
| number, number | The x and y screen coordinates. |
sm.render.isOutdoor()
Client only
Checks if client is outdoor
Returns:
| Type | Description |
|---|---|
| boolean | True if local client is outdoor. |
sm.render.resetAllReflectionColor()
Client only
Resets all the reflection color settings.
sm.render.resetCameraLight()
Resets the camera light override settings.
sm.render.resetFog()
Client only
Resets the fog override settings.
sm.render.resetGI()
Client only
Resets the global illumination override settings.
sm.render.resetHorizonLight()
Client only
Resets the Horizon light settings.
sm.render.resetLUT()
Client only
Resets the LUT override settings.
sm.render.resetVolumetricFog()
Client only
Resets the Volumetric fog override settings.
sm.render.resetVoxelLODBoost()
Client only
Resets the voxel terrain LOD boost override setting.
sm.render.setCameraLight(intensity, range, color, farIntensity?, farRange?, farColor?)
Client only
Sets the camera light override settings.
Optionally sets far camera light settings (used for camera pullback lerp).
Parameters:
| Type | Name | Description |
|---|---|---|
| number | intensity | The light intensity. |
| number | range | Light range. |
| Color | color | Light color. |
| number | farIntensity? | Far light intensity. (Optional) |
| number | farRange? | Far light range. (Optional) |
| Color | farColor? | Far light color. (Optional) |
sm.render.setCinematic(cinematic)
Client only
Sets if a cinematic is playing
Parameters:
| Type | Name | Description |
|---|---|---|
| boolean | cinematic | If true, sets to cinematic |
sm.render.setCloudSettings(coverage, height, radius, tallnessScale, directionalLightMod, scroll, scrollRotation)
Client only
Sets the cloud settings.
Parameters:
| Type | Name | Description |
|---|---|---|
| number | coverage | The fraction of the cloud coverage. |
| number | height | The cloud height. |
| number | radius | The atmosphere radius. |
| number | tallnessScale | The tallness scale(0.1 - 4.0). |
| number | directionalLightMod | Directional light mod (0.0 - 1.0). |
| Vec3 | scroll | Cloud scroll. |
| Vec3 | scrollRotation | Cloud scroll rotation. |
sm.render.setFog(startDistance, endDistance, falloffFactor, startColor, endColor, verticalOpacity, verticalFadeDistance, verticalFalloff, verticalStart, verticalEnd, verticalStartColor, verticalEndColor, fadeDistance)
Client only
Sets the fog override settings.
Parameters:
| Type | Name | Description |
|---|---|---|
| number | startDistance | Fog start distance. |
| number | endDistance | Fog end distance. |
| number | falloffFactor | Fog falloff. |
| Color | startColor | Fog start color. |
| Color | endColor | Fog end color. |
| number | verticalOpacity | Vertical fog opacity. (Optional) |
| number | verticalFadeDistance | Vertical fog fade distance. (Optional) |
| number | verticalFalloff | Vertical fog falloff. (Optional) |
| number | verticalStart | Vertical fog start distance. (Optional) |
| number | verticalEnd | Vertical fog end distance. (Optional) |
| Color | verticalStartColor | Vertical fog start color. (Optional) |
| Color | verticalEndColor | Vertical fog end color. (Optional) |
| number | fadeDistance | Fog fade distance. (Optional) |
sm.render.setGI(weight)
Client only
Sets the global illumination override settings.
Parameters:
| Type | Name | Description |
|---|---|---|
| number | weight | GI weight. |
sm.render.setHorizonLight(topColor, horizonColor, bottomColor, direction, start, end, falloff)
Client only
Sets the Horizon light settings.
Parameters:
| Type | Name | Description |
|---|---|---|
| Color | topColor | Color of the top of the horizon light. |
| Color | horizonColor | Color of the horizon of the horizon light. |
| Color | bottomColor | Color of the bottom of the horizon light. |
| Vec3 | direction | Direction of the horizon light. |
| number | start | Start distance for the horizon light. (Optional) |
| number | end | End distance for the horizon light. (Optional) |
| number | falloff | Falloff factor for the horizon light. (Optional) |
sm.render.setLUT(LUT-A, LUT-B?, blend?)
Client only
Sets the LUT override settings.
Parameters:
| Type | Name | Description |
|---|---|---|
| string | LUT-A | Name of LUT A. |
| string | LUT-B? | Name of LUT B. |
| number | blend? | blend between 0.0 and 1.0 for LUT A and B. (Defaults to 0.0) |
sm.render.setOutdoorLighting(value)
Client only
Sets the lighting cycle fraction.
Parameters:
| Type | Name | Description |
|---|---|---|
| number | value | The fraction of the day cycle lighting. |
sm.render.setReflectionLevelColor(settingsLevel, min, max, mul)
Client only
Sets the reflection color correction settings for one reflection level.
Parameters:
| Type | Name | Description |
|---|---|---|
| string | settingsLevel | Off/Low/Medium/High. |
| number | min | Color min. |
| number | max | Color max. |
| number | mul | Color mul. |
sm.render.setVolumetricFog(min, max, loopSpeed, scrollSpeed, scale, intensity)
Client only
Sets the Volumetric fog override settings.
Parameters:
| Type | Name | Description |
|---|---|---|
| number | min | Fog min. |
| number | max | Fog max. |
| number | loopSpeed | Fog loop speed. |
| Vec3 | scrollSpeed | Fog scroll speed. |
| Vec3 | scale | Fog scale. |
| number | intensity | Fog intensity. |
sm.render.setVoxelLODBoost(boost)
Client only
Sets the voxel terrain LOD boost override setting.
The value is capped by the current draw distance quality.
Parameters:
| Type | Name | Description |
|---|---|---|
| number | boost | Voxel terrain LOD boost. |