sm.render

Render settings

Functions:

  • getDefaultCameraLight
  • getDefaultFog
  • getDefaultGI
  • getDefaultHorizonLight
  • getDefaultReflectionColor
  • getDefaultVolumetricFog
  • getDefaultVoxelLODBoost
  • getDrawDistance
  • getOutdoorLighting
  • getScreenCoordinatesFromWorldPosition
  • isOutdoor
  • resetAllReflectionColor
  • resetCameraLight
  • resetFog
  • resetGI
  • resetHorizonLight
  • resetLUT
  • resetVolumetricFog
  • resetVoxelLODBoost
  • setCameraLight
  • setCinematic
  • setCloudSettings
  • setFog
  • setGI
  • setHorizonLight
  • setLUT
  • setOutdoorLighting
  • setReflectionLevelColor
  • setVolumetricFog
  • setVoxelLODBoost

  • sm.render.getDefaultCameraLight()

    Gets a table of the default camera light render settings.

    Returns:

    TypeDescription
    tableThe default camera light render settings.

    sm.render.getDefaultFog()

    Gets a table of the default fog render settings.

    Returns:

    TypeDescription
    tableThe default fog render settings.

    sm.render.getDefaultGI()

    Gets a table of the default GI render settings.

    Returns:

    TypeDescription
    tableThe default GI render settings.

    sm.render.getDefaultHorizonLight()

    Gets a table of the default horizon light render settings.

    Returns:

    TypeDescription
    tableThe default horizon light render settings.

    sm.render.getDefaultReflectionColor()

    Gets a table of the default reflection color render settings.

    Returns:

    TypeDescription
    tableThe default reflection color render settings.

    sm.render.getDefaultVolumetricFog()

    Gets a table of the default Volumetric fog render settings.

    Returns:

    TypeDescription
    tableThe default Volumetric fog render settings.

    sm.render.getDefaultVoxelLODBoost()

    Gets the default voxel LOD boost render setting.

    Returns:

    TypeDescription
    numberThe default voxel LOD boost render setting.

    sm.render.getDrawDistance()

    Client only

    Gets the draw distance.

    Returns:

    TypeDescription
    numberThe draw distance.

    sm.render.getOutdoorLighting()

    Client only

    Gets the lighting cycle fraction.

    Returns:

    TypeDescription
    numberThe fraction of the day cycle lighting.

    sm.render.getScreenCoordinatesFromWorldPosition(pos, width, height)

    Return the screen coordinates that align with the given world position.

    Parameters:

    TypeNameDescription
    Vec3posWorld position to align
    integerwidthScreen width
    integerheightScreen height

    Returns:

    TypeDescription
    number, numberThe x and y screen coordinates.

    sm.render.isOutdoor()

    Client only

    Checks if client is outdoor

    Returns:

    TypeDescription
    booleanTrue 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:

    TypeNameDescription
    numberintensityThe light intensity.
    numberrangeLight range.
    ColorcolorLight color.
    numberfarIntensity?Far light intensity. (Optional)
    numberfarRange?Far light range. (Optional)
    ColorfarColor?Far light color. (Optional)

    sm.render.setCinematic(cinematic)

    Client only

    Sets if a cinematic is playing

    Parameters:

    TypeNameDescription
    booleancinematicIf true, sets to cinematic

    sm.render.setCloudSettings(coverage, height, radius, tallnessScale, directionalLightMod, scroll, scrollRotation)

    Client only

    Sets the cloud settings.

    Parameters:

    TypeNameDescription
    numbercoverageThe fraction of the cloud coverage.
    numberheightThe cloud height.
    numberradiusThe atmosphere radius.
    numbertallnessScaleThe tallness scale(0.1 - 4.0).
    numberdirectionalLightModDirectional light mod (0.0 - 1.0).
    Vec3scrollCloud scroll.
    Vec3scrollRotationCloud 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:

    TypeNameDescription
    numberstartDistanceFog start distance.
    numberendDistanceFog end distance.
    numberfalloffFactorFog falloff.
    ColorstartColorFog start color.
    ColorendColorFog end color.
    numberverticalOpacityVertical fog opacity. (Optional)
    numberverticalFadeDistanceVertical fog fade distance. (Optional)
    numberverticalFalloffVertical fog falloff. (Optional)
    numberverticalStartVertical fog start distance. (Optional)
    numberverticalEndVertical fog end distance. (Optional)
    ColorverticalStartColorVertical fog start color. (Optional)
    ColorverticalEndColorVertical fog end color. (Optional)
    numberfadeDistanceFog fade distance. (Optional)

    sm.render.setGI(weight)

    Client only

    Sets the global illumination override settings.

    Parameters:

    TypeNameDescription
    numberweightGI weight.

    sm.render.setHorizonLight(topColor, horizonColor, bottomColor, direction, start, end, falloff)

    Client only

    Sets the Horizon light settings.

    Parameters:

    TypeNameDescription
    ColortopColorColor of the top of the horizon light.
    ColorhorizonColorColor of the horizon of the horizon light.
    ColorbottomColorColor of the bottom of the horizon light.
    Vec3directionDirection of the horizon light.
    numberstartStart distance for the horizon light. (Optional)
    numberendEnd distance for the horizon light. (Optional)
    numberfalloffFalloff factor for the horizon light. (Optional)

    sm.render.setLUT(LUT-A, LUT-B?, blend?)

    Client only

    Sets the LUT override settings.

    Parameters:

    TypeNameDescription
    stringLUT-AName of LUT A.
    stringLUT-B?Name of LUT B.
    numberblend?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:

    TypeNameDescription
    numbervalueThe 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:

    TypeNameDescription
    stringsettingsLevelOff/Low/Medium/High.
    numberminColor min.
    numbermaxColor max.
    numbermulColor mul.

    sm.render.setVolumetricFog(min, max, loopSpeed, scrollSpeed, scale, intensity)

    Client only

    Sets the Volumetric fog override settings.

    Parameters:

    TypeNameDescription
    numberminFog min.
    numbermaxFog max.
    numberloopSpeedFog loop speed.
    Vec3scrollSpeedFog scroll speed.
    Vec3scaleFog scale.
    numberintensityFog 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:

    TypeNameDescription
    numberboostVoxel terrain LOD boost.