Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
Highlighting.HighlightingSystem Class Reference
Inheritance diagram for Highlighting.HighlightingSystem:

Public Member Functions

virtual bool CheckInstance ()
 
virtual void Cycle ()
 Turn Highlighting System On. More...
 
virtual void Disable ()
 Turn Highlighting System Off. More...
 
void ReloadSettings ()
 

Static Public Member Functions

static bool CheckSupported ()
 

Public Attributes

float offsetFactor = 0f
 Depth offset units for highlighting shaders. More...
 
float offsetUnits = 0f
 Highlighting buffer size downsample factor. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void FillBuffer (CommandBuffer buffer, int renderQueue)
 
virtual int GetAA ()
 
virtual bool HighlightersChanged ()
 
virtual void OnDestroy ()
 
virtual void OnDisable ()
 
virtual void OnEnable ()
 
virtual void OnPreRender ()
 
virtual void OnRenderImage (RenderTexture src, RenderTexture dst)
 
virtual void OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 
virtual void OnSceneUnloaded (UnityEngine.SceneManagement.Scene scene)
 
virtual void RebuildCommandBuffer ()
 
virtual IEnumerator RefreshCoroutine (int n=10)
 
virtual void UpdateHighlightingBuffer ()
 

Static Protected Member Functions

static void CreateQuad ()
 
static void Initialize ()
 

Protected Attributes

float _blurIntensity = 0.3f
 RenderTargetidentifier for the highlightingBuffer RenderTexture. More...
 
float _blurMinSpread = 0.65f
 
float _blurSpread = 0.25f
 
int _downsampleFactor = 4
 
int _iterations = 2
 
const int BLUR = 0
 
Material blurMaterial
 
int cachedAA = -1
 
int cachedHeight = -1
 
int cachedWidth = -1
 
Camera cam = null
 True if HighlightingSystem is supported on this platform. More...
 
const int COMP = 2
 
const int CUT = 1
 
const int D3D11 = 2
 Current graphics device version: 0 = OpenGL or unknown (default), 1 = Direct3D 9, 2 = Direct3D 11. More...
 
const int D3D9 = 1
 
RenderTexture highlightingBuffer = null
 Camera reference. More...
 
RenderTargetIdentifier highlightingBufferID
 RenderTexture with highlighting buffer. More...
 
bool isDepthAvailable = true
 Material parameters. More...
 
bool isDirty = true
 
bool isSupported = false
 
const int OGL = 0
 
const CameraEvent queue = CameraEvent.BeforeImageEffectsOpaque
 
CommandBuffer renderBuffer
 

Static Protected Attributes

static RenderTargetIdentifier cameraTargetID
 
static readonly Color colorClear = new Color(0f, 0f, 0f, 0f)
 
static Material compMaterial
 Dynamic materials. More...
 
static Material cutMaterial
 
static int graphicsDeviceVersion = D3D9
 
static readonly Matrix4x4 identityMatrix = Matrix4x4.identity
 
static bool initialized = false
 
static Material[] materials
 Static materials. More...
 
static Mesh quad
 Graphics device version identifiers. More...
 
static readonly string renderBufferName = "HighlightingSystem"
 
static readonly string[] shaderPaths
 
static Shader[] shaders
 

Properties

float blurIntensity [get, set]
 
float blurMinSpread [get, set]
 
float blurSpread [get, set]
 
int downsampleFactor [get, set]
 
static bool FxEnabled [get, set]
 
bool IsDepthAvailable [get]
 
bool IsSupported [get]
 
int iterations [get, set]
 

Member Function Documentation

virtual void Highlighting.HighlightingSystem.Awake ( )
inlineprotectedvirtual
virtual bool Highlighting.HighlightingSystem.CheckInstance ( )
inlinevirtual
static bool Highlighting.HighlightingSystem.CheckSupported ( )
inlinestatic

< Image Effects supported?

static void Highlighting.HighlightingSystem.CreateQuad ( )
inlinestaticprotected
virtual void Highlighting.HighlightingSystem.Cycle ( )
inlinevirtual

Turn Highlighting System On.

virtual void Highlighting.HighlightingSystem.Disable ( )
inlinevirtual

Turn Highlighting System Off.

virtual void Highlighting.HighlightingSystem.FillBuffer ( CommandBuffer  buffer,
int  renderQueue 
)
inlineprotectedvirtual
virtual int Highlighting.HighlightingSystem.GetAA ( )
inlineprotectedvirtual
virtual bool Highlighting.HighlightingSystem.HighlightersChanged ( )
inlineprotectedvirtual

< Check if list of highlighted objects has changed

static void Highlighting.HighlightingSystem.Initialize ( )
inlinestaticprotected

< Determine graphics device version

< Initialize shaders and materials

< Initialize static RenderTargetIdentifiers

< Create static quad mesh

virtual void Highlighting.HighlightingSystem.OnDestroy ( )
inlineprotectedvirtual
virtual void Highlighting.HighlightingSystem.OnDisable ( )
inlineprotectedvirtual
virtual void Highlighting.HighlightingSystem.OnEnable ( )
inlineprotectedvirtual

< Set initial intensity in blur material

< Force-rebuild renderBuffer

virtual void Highlighting.HighlightingSystem.OnPreRender ( )
inlineprotectedvirtual

< In case MSAA is enabled in forward/vertex lit rendeirng paths - depth buffer is not available

< Update ZWrite value for all highlighting shaders correspondingly (isDepthAvailable ? ZWrite Off : ZWrite On)

virtual void Highlighting.HighlightingSystem.OnRenderImage ( RenderTexture  src,
RenderTexture  dst 
)
inlineprotectedvirtual
virtual void Highlighting.HighlightingSystem.OnSceneLoaded ( UnityEngine.SceneManagement.Scene  scene,
UnityEngine.SceneManagement.LoadSceneMode  mode 
)
inlineprotectedvirtual
virtual void Highlighting.HighlightingSystem.OnSceneUnloaded ( UnityEngine.SceneManagement.Scene  scene)
inlineprotectedvirtual
virtual void Highlighting.HighlightingSystem.RebuildCommandBuffer ( )
inlineprotectedvirtual

< Prepare and clear render target

< Fill buffer with highlighters rendering commands

< Highlighters

< Occluders

< See-through Highlighters

< Blur the small texture

< Cleanup

virtual IEnumerator Highlighting.HighlightingSystem.RefreshCoroutine ( int  n = 10)
inlineprotectedvirtual
void Highlighting.HighlightingSystem.ReloadSettings ( )
inline
virtual void Highlighting.HighlightingSystem.UpdateHighlightingBuffer ( )
inlineprotectedvirtual

< Always set as dirty, because camera width/height/anti-aliasing has changed

Member Data Documentation

float Highlighting.HighlightingSystem._blurIntensity = 0.3f
protected

RenderTargetidentifier for the highlightingBuffer RenderTexture.

float Highlighting.HighlightingSystem._blurMinSpread = 0.65f
protected
float Highlighting.HighlightingSystem._blurSpread = 0.25f
protected
int Highlighting.HighlightingSystem._downsampleFactor = 4
protected
int Highlighting.HighlightingSystem._iterations = 2
protected
const int Highlighting.HighlightingSystem.BLUR = 0
protected
Material Highlighting.HighlightingSystem.blurMaterial
protected
int Highlighting.HighlightingSystem.cachedAA = -1
protected
int Highlighting.HighlightingSystem.cachedHeight = -1
protected
int Highlighting.HighlightingSystem.cachedWidth = -1
protected
Camera Highlighting.HighlightingSystem.cam = null
protected

True if HighlightingSystem is supported on this platform.

RenderTargetIdentifier Highlighting.HighlightingSystem.cameraTargetID
staticprotected
readonly Color Highlighting.HighlightingSystem.colorClear = new Color(0f, 0f, 0f, 0f)
staticprotected
const int Highlighting.HighlightingSystem.COMP = 2
protected
Material Highlighting.HighlightingSystem.compMaterial
staticprotected

Dynamic materials.

const int Highlighting.HighlightingSystem.CUT = 1
protected
Material Highlighting.HighlightingSystem.cutMaterial
staticprotected
const int Highlighting.HighlightingSystem.D3D11 = 2
protected

Current graphics device version: 0 = OpenGL or unknown (default), 1 = Direct3D 9, 2 = Direct3D 11.

const int Highlighting.HighlightingSystem.D3D9 = 1
protected
int Highlighting.HighlightingSystem.graphicsDeviceVersion = D3D9
staticprotected
RenderTexture Highlighting.HighlightingSystem.highlightingBuffer = null
protected

Camera reference.

RenderTargetIdentifier Highlighting.HighlightingSystem.highlightingBufferID
protected

RenderTexture with highlighting buffer.

readonly Matrix4x4 Highlighting.HighlightingSystem.identityMatrix = Matrix4x4.identity
staticprotected
bool Highlighting.HighlightingSystem.initialized = false
staticprotected
bool Highlighting.HighlightingSystem.isDepthAvailable = true
protected

Material parameters.

bool Highlighting.HighlightingSystem.isDirty = true
protected
bool Highlighting.HighlightingSystem.isSupported = false
protected
Material [] Highlighting.HighlightingSystem.materials
staticprotected

Static materials.

float Highlighting.HighlightingSystem.offsetFactor = 0f

Depth offset units for highlighting shaders.

float Highlighting.HighlightingSystem.offsetUnits = 0f

Highlighting buffer size downsample factor.

const int Highlighting.HighlightingSystem.OGL = 0
protected
Mesh Highlighting.HighlightingSystem.quad
staticprotected

Graphics device version identifiers.

const CameraEvent Highlighting.HighlightingSystem.queue = CameraEvent.BeforeImageEffectsOpaque
protected
CommandBuffer Highlighting.HighlightingSystem.renderBuffer
protected
readonly string Highlighting.HighlightingSystem.renderBufferName = "HighlightingSystem"
staticprotected
readonly string [] Highlighting.HighlightingSystem.shaderPaths
staticprotected
Initial value:
= new string[]
{
"Hidden/Highlighted/Blur",
"Hidden/Highlighted/Cut",
"Hidden/Highlighted/Composite",
}
Shader [] Highlighting.HighlightingSystem.shaders
staticprotected

Property Documentation

float Highlighting.HighlightingSystem.blurIntensity
getset
float Highlighting.HighlightingSystem.blurMinSpread
getset
float Highlighting.HighlightingSystem.blurSpread
getset
int Highlighting.HighlightingSystem.downsampleFactor
getset
bool Highlighting.HighlightingSystem.FxEnabled
staticgetset
bool Highlighting.HighlightingSystem.IsDepthAvailable
get
bool Highlighting.HighlightingSystem.IsSupported
get
int Highlighting.HighlightingSystem.iterations
getset

The documentation for this class was generated from the following file: