Barotrauma Client Doc
Barotrauma.WaterRenderer Class Reference
Inheritance diagram for Barotrauma.WaterRenderer:

Public Member Functions

 WaterRenderer (GraphicsDevice graphicsDevice)
 
void RenderWater (SpriteBatch spriteBatch, RenderTarget2D texture, Camera cam)
 
void ScrollWater (Vector2 vel, float deltaTime)
 
void RenderAir (GraphicsDevice graphicsDevice, Camera cam, RenderTarget2D texture, Matrix transform)
 
void ResetBuffers ()
 
void Dispose ()
 

Public Attributes

readonly Color waterColor = new Color(0.75f * 0.5f, 0.8f * 0.5f, 0.9f * 0.5f, 1.0f)
 
readonly WaterVertexData IndoorsWaterColor = new WaterVertexData(0.1f, 0.1f, 0.5f, 1.0f)
 
readonly WaterVertexData IndoorsSurfaceTopColor = new WaterVertexData(0.5f, 0.5f, 0.0f, 1.0f)
 
readonly WaterVertexData IndoorsSurfaceBottomColor = new WaterVertexData(0.2f, 0.1f, 0.9f, 1.0f)
 
VertexPositionTexture[] vertices = new VertexPositionTexture[DefaultBufferSize]
 
Dictionary< EntityGrid, VertexPositionColorTexture[]> IndoorsVertices = new Dictionary<EntityGrid, VertexPositionColorTexture[]>()
 
int PositionInBuffer = 0
 
Dictionary< EntityGrid, int > PositionInIndoorsBuffer = new Dictionary<EntityGrid, int>()
 

Static Public Attributes

static WaterRenderer Instance
 
const int DefaultBufferSize = 2000
 
const int DefaultIndoorsBufferSize = 3000
 
static Vector2 DistortionScale = new Vector2(2f, 1.5f)
 
static Vector2 DistortionStrength = new Vector2(0.01f, 0.33f)
 
static float BlurAmount = 0.0f
 

Properties

Vector2 WavePos [get]
 
Effect WaterEffect [get]
 
Texture2D WaterTexture [get]
 

Detailed Description

Definition at line 29 of file WaterRenderer.cs.

Constructor & Destructor Documentation

◆ WaterRenderer()

Barotrauma.WaterRenderer.WaterRenderer ( GraphicsDevice  graphicsDevice)

Definition at line 67 of file WaterRenderer.cs.

Member Function Documentation

◆ Dispose()

void Barotrauma.WaterRenderer.Dispose ( )

Definition at line 224 of file WaterRenderer.cs.

◆ RenderAir()

void Barotrauma.WaterRenderer.RenderAir ( GraphicsDevice  graphicsDevice,
Camera  cam,
RenderTarget2D  texture,
Matrix  transform 
)

Definition at line 187 of file WaterRenderer.cs.

◆ RenderWater()

void Barotrauma.WaterRenderer.RenderWater ( SpriteBatch  spriteBatch,
RenderTarget2D  texture,
Camera  cam 
)

Definition at line 88 of file WaterRenderer.cs.

◆ ResetBuffers()

void Barotrauma.WaterRenderer.ResetBuffers ( )

Definition at line 206 of file WaterRenderer.cs.

◆ ScrollWater()

void Barotrauma.WaterRenderer.ScrollWater ( Vector2  vel,
float  deltaTime 
)

Definition at line 182 of file WaterRenderer.cs.

Member Data Documentation

◆ BlurAmount

float Barotrauma.WaterRenderer.BlurAmount = 0.0f
static

Definition at line 38 of file WaterRenderer.cs.

◆ DefaultBufferSize

const int Barotrauma.WaterRenderer.DefaultBufferSize = 2000
static

Definition at line 33 of file WaterRenderer.cs.

◆ DefaultIndoorsBufferSize

const int Barotrauma.WaterRenderer.DefaultIndoorsBufferSize = 3000
static

Definition at line 34 of file WaterRenderer.cs.

◆ DistortionScale

Vector2 Barotrauma.WaterRenderer.DistortionScale = new Vector2(2f, 1.5f)
static

Definition at line 36 of file WaterRenderer.cs.

◆ DistortionStrength

Vector2 Barotrauma.WaterRenderer.DistortionStrength = new Vector2(0.01f, 0.33f)
static

Definition at line 37 of file WaterRenderer.cs.

◆ IndoorsSurfaceBottomColor

readonly WaterVertexData Barotrauma.WaterRenderer.IndoorsSurfaceBottomColor = new WaterVertexData(0.2f, 0.1f, 0.9f, 1.0f)

Definition at line 50 of file WaterRenderer.cs.

◆ IndoorsSurfaceTopColor

readonly WaterVertexData Barotrauma.WaterRenderer.IndoorsSurfaceTopColor = new WaterVertexData(0.5f, 0.5f, 0.0f, 1.0f)

Definition at line 49 of file WaterRenderer.cs.

◆ IndoorsVertices

Dictionary<EntityGrid, VertexPositionColorTexture[]> Barotrauma.WaterRenderer.IndoorsVertices = new Dictionary<EntityGrid, VertexPositionColorTexture[]>()

Definition at line 53 of file WaterRenderer.cs.

◆ IndoorsWaterColor

readonly WaterVertexData Barotrauma.WaterRenderer.IndoorsWaterColor = new WaterVertexData(0.1f, 0.1f, 0.5f, 1.0f)

Definition at line 48 of file WaterRenderer.cs.

◆ Instance

WaterRenderer Barotrauma.WaterRenderer.Instance
static

Definition at line 31 of file WaterRenderer.cs.

◆ PositionInBuffer

int Barotrauma.WaterRenderer.PositionInBuffer = 0

Definition at line 62 of file WaterRenderer.cs.

◆ PositionInIndoorsBuffer

Dictionary<EntityGrid, int> Barotrauma.WaterRenderer.PositionInIndoorsBuffer = new Dictionary<EntityGrid, int>()

Definition at line 63 of file WaterRenderer.cs.

◆ vertices

VertexPositionTexture [] Barotrauma.WaterRenderer.vertices = new VertexPositionTexture[DefaultBufferSize]

Definition at line 52 of file WaterRenderer.cs.

◆ waterColor

readonly Color Barotrauma.WaterRenderer.waterColor = new Color(0.75f * 0.5f, 0.8f * 0.5f, 0.9f * 0.5f, 1.0f)

Definition at line 46 of file WaterRenderer.cs.

Property Documentation

◆ WaterEffect

Effect Barotrauma.WaterRenderer.WaterEffect
get

Definition at line 55 of file WaterRenderer.cs.

◆ WaterTexture

Texture2D Barotrauma.WaterRenderer.WaterTexture
get

Definition at line 65 of file WaterRenderer.cs.

◆ WavePos

Vector2 Barotrauma.WaterRenderer.WavePos
get

Definition at line 40 of file WaterRenderer.cs.