s&box
RustCounter-Strike 2s&boxDeadlock
Wiki
Get s&box on Steam
Browse
OverviewGetting StartedCreating GamesEngine & ToolsDocumentationCommunity GamesResources
s&boxDocumentationRenderingShadersClassesDynamic Reflections
SOURCE 2 · C#
Build and play games with s&box.

Facepunch's game engine and creation platform — make games in C#, or jump straight into community games.

Get s&box on Steam

s&box Wiki

  • Overview
  • Getting Started
  • Creating Games
  • Engine & Tools
  • Documentation
  • Community Games
  • Resources

Tools & Community

  • Getting Started
  • Creating Games
  • Engine & Tools
  • Resources

Platforms

  • RustBattle
  • CSBattle
  • Rust Game Wiki
  • CS2 Skins Wiki
  • Deadlock Wiki

About

  • Official Site
  • Developer Wiki
  • GitHub
  • Get on Steam
NOT AFFILIATED WITH FACEPUNCH STUDIOS · © 2026 s&box Wiki (community)
Docs/Rendering
Rendering

Dynamic Reflections

Much like SSAO, you can composite dynamic specular reflections on your object, whether they are SSR or eventually Raytraced Reflections

You can use it directly by sampling on your shader:

float4 DynamicReflections::Sample( float2 ScreenPosition, float Roughness = 0.0f )

On the standard shading model they are composited with the correct BRDF, so it respects the reflection value from Metalness and Roughness set by it

Custom Dynamic Reflections

You can implement your own dynamic reflections solution simply by providing the dynamic reflection texture globally from your own component:

commands.SetGlobal( "ReflectionColorIndex", PlanarReflection.ColorIndex );

Roughness parameter when sampling will optionally get a specific mip level from your texture from 0.0f to 1.0f to composite with variable blurriness based on how rough the overlayed material is

DynamicReflections::IsEnabled() tells you whether there's a reflection texture bound at all, so you can skip the work when there isn't.

Overriding Indirect Specular Reflections For Disabling

Since you are overriding the envmap reflections of an object, overriding reflection color can also be used to force them off entirely

commands.SetGlobal( "ReflectionColorIndex", Texture.Black.ColorIndex );

Source: Facepunch/sbox-docs (CC-BY-4.0) · updated 2025-07-30. Read it rendered on the official docs.

More in Rendering

AmbientLight
Animated Effects
Attributes and Variables
BeamEffect
Beams
Bindless API
C# Shader Nodes
Classes
← All documentation

Community wiki — not affiliated with Facepunch Studios. For the latest and most authoritative information, see the official developer wiki.