LightsprintSDK 2021.08.08
rr_gl::UberProgramSetup Struct Reference

#include <UberProgramSetup.h>

Public Member Functions

 UberProgramSetup ()
 
void enableAllLights ()
 
void enableAllMaterials ()
 
void enableUsedMaterials (const rr::RRMaterial *material, const rr::RRMeshArrays *meshArrays)
 
void reduceMaterials (const UberProgramSetup &fullMaterial)
 
const char * getSetupString ()
 
bool operator== (const UberProgramSetup &a) const
 
bool operator< (const UberProgramSetup &a) const
 
unsigned getComplexity () const
 
ProgramgetProgram (UberProgram *uberProgram)
 
unsigned detectMaxShadowmaps (UberProgram *uberProgram, int argc=0, const char *const *argv=nullptr)
 
void validate ()
 
ProgramuseProgram (UberProgram *uberProgram, const rr::RRCamera *camera, RealtimeLight *light, unsigned firstInstance, float lightDirectMultiplier, const rr::RRVec4 *brightness, float gamma, const ClipPlanes *clipPlanes)
 
void useCamera (Program *program, const rr::RRCamera *camera)
 
void useMaterial (Program *program, const rr::RRMaterial *material, float materialEmittanceMultiplier, float animationTime) const
 
void useIlluminationEnvMap (Program *program, const rr::RRBuffer *environment)
 
void useIlluminationMirror (Program *program, const rr::RRBuffer *mirrorMap)
 
void useWorldMatrix (Program *program, const rr::RRObject *object)
 

Static Public Member Functions

static void checkCapabilities ()
 

Public Attributes

unsigned char SHADOW_MAPS:4
 
unsigned char SHADOW_SAMPLES:4
 
bool SHADOW_COLOR:1
 
bool SHADOW_PENUMBRA:1
 
bool SHADOW_CASCADE:1
 
bool SHADOW_ONLY:1
 
bool LIGHT_DIRECT:1
 
bool LIGHT_DIRECT_COLOR:1
 
bool LIGHT_DIRECT_MAP:1
 
bool LIGHT_DIRECTIONAL:1
 
bool LIGHT_DIRECT_ATT_SPOT:1
 
bool LIGHT_DIRECT_ATT_REALISTIC:1
 
bool LIGHT_DIRECT_ATT_POLYNOMIAL:1
 
bool LIGHT_DIRECT_ATT_EXPONENTIAL:1
 
bool LIGHT_INDIRECT_CONST:1
 
bool LIGHT_INDIRECT_VCOLOR:1
 
bool LIGHT_INDIRECT_VCOLOR2:1
 
bool LIGHT_INDIRECT_VCOLOR_LINEAR:1
 
bool LIGHT_INDIRECT_MAP:1
 
bool LIGHT_INDIRECT_MAP2:1
 
bool LIGHT_INDIRECT_DETAIL_MAP:1
 
bool LIGHT_INDIRECT_ENV_DIFFUSE:1
 
bool LIGHT_INDIRECT_ENV_SPECULAR:1
 
bool LIGHT_INDIRECT_ENV_REFRACT:1
 
bool LIGHT_INDIRECT_MIRROR_DIFFUSE:1
 
bool LIGHT_INDIRECT_MIRROR_SPECULAR:1
 
bool LIGHT_INDIRECT_MIRROR_MIPMAPS:1
 
bool MATERIAL_DIFFUSE:1
 
bool MATERIAL_DIFFUSE_X2:1
 
bool MATERIAL_DIFFUSE_CONST:1
 
bool MATERIAL_DIFFUSE_MAP:1
 
bool MATERIAL_SPECULAR:1
 
bool MATERIAL_SPECULAR_CONST:1
 
bool MATERIAL_SPECULAR_MAP:1
 
unsigned char MATERIAL_SPECULAR_MODEL:2
 
bool MATERIAL_EMISSIVE_CONST:1
 
bool MATERIAL_EMISSIVE_MAP:1
 
bool MATERIAL_TRANSPARENCY_CONST:1
 
bool MATERIAL_TRANSPARENCY_MAP:1
 
bool MATERIAL_TRANSPARENCY_IN_ALPHA:1
 
bool MATERIAL_TRANSPARENCY_NOISE:1
 
bool MATERIAL_TRANSPARENCY_BLEND:1
 
bool MATERIAL_TRANSPARENCY_TO_RGB:1
 
bool MATERIAL_TRANSPARENCY_FRESNEL:1
 
bool MATERIAL_BUMP_MAP:1
 
bool MATERIAL_BUMP_TYPE_HEIGHT:1
 
bool MATERIAL_NORMAL_MAP_FLOW:1
 
bool MATERIAL_CULLING:1
 
bool ANIMATION_WAVE:1
 
bool POSTPROCESS_NORMALS:1
 
bool POSTPROCESS_BRIGHTNESS:1
 
bool POSTPROCESS_GAMMA:1
 
bool POSTPROCESS_BIGSCREEN:1
 
bool OBJECT_SPACE:1
 
bool CLIP_PLANE:1
 
bool CLIP_PLANE_XA:1
 
bool CLIP_PLANE_XB:1
 
bool CLIP_PLANE_YA:1
 
bool CLIP_PLANE_YB:1
 
bool CLIP_PLANE_ZA:1
 
bool CLIP_PLANE_ZB:1
 
bool FORCE_2D_POSITION:1
 
bool LEGACY_GL:1
 
const char * comment
 

Detailed Description

Options that change code of UberProgram made of UberShader.vs/fs.

UberProgram + UberProgramSetup = Program

All attribute values are converted to "#define ATTRIBUTE [value]" format and inserted at the beginning of ubershader.

Some combinations of attributes are not supported and getProgram will return nullptr. Call validate() to get the nearest supported combination.

LIGHT_INDIRECT_XXX flags enable rendering of indirect illumination in various situations, using various techniques. Shader accumulates illumination from all enabled techniques, so if you build it with multiple techniques enabled, you can end up with higher than expected indirect illumination. On the other hand, high level interface of PluginParamsScene is designed to be called with multiple techniques enabled; plugin automatically selects optimal technique out of enabled ones and disables the rest before building shader (selection is based on material and illumination buffers available in object).

Constructor & Destructor Documentation

◆ UberProgramSetup()

rr_gl::UberProgramSetup::UberProgramSetup ( )
inline

Creates UberProgramSetup with everything turned off by default. It is suitable for rendering opaque faces into shadowmap, no color is produced, only depth.

Member Function Documentation

◆ enableAllLights()

void rr_gl::UberProgramSetup::enableAllLights ( )

Prepares for rendering with all lighting features, enables all SHADOW_XXX and LIGHT_XXX relevant for PluginParamsScene.

Certain shadow and light flags are enabled, you can disable individual flags to prevent renderer from using given features. Some flags are not touched, they depend on light properties and plugin sets them automatically.

◆ enableAllMaterials()

void rr_gl::UberProgramSetup::enableAllMaterials ( )

Prepares for rendering with all material features, enables all MATERIAL_XXX relevant for PluginParamsScene.

Nearly all material flags are enabled, you can disable individual flags to prevent renderer from using given features.

◆ enableUsedMaterials()

void rr_gl::UberProgramSetup::enableUsedMaterials ( const rr::RRMaterial material,
const rr::RRMeshArrays meshArrays 
)

Enables only MATERIAL_XXX required by given material, disables unused MATERIAL_XXX.

With meshArrays provided, enables only features supported by mesh, e.g. MATERIAL_BUMP_MAP only if tangents, bitangents and selected uv channel are present. With meshArrays nullptr, works as if mesh contains all uv channels necessary, but no tangents (so normal maps will be disabled).

◆ reduceMaterials()

void rr_gl::UberProgramSetup::reduceMaterials ( const UberProgramSetup fullMaterial)

Reduces material setup, removes properties not present in fullMaterial.

Note: MATERIAL_XXX_MAP is considered superset of MATERIAL_XXX_CONST, so mixing MATERIAL_XXX_CONST in this or fullMaterial, and MATERIAL_XXX_MAP in the other input, leads to MATERIAL_XXX_CONST set.

◆ getSetupString()

const char * rr_gl::UberProgramSetup::getSetupString ( )

Returns our attribute values in format suitable for our uberprogram. Example: "#define SHADOW_MAPS 2\n#define SHADOW_SAMPLES 4\n#define MATERIAL_DIFFUSE\n".

◆ operator==()

bool rr_gl::UberProgramSetup::operator== ( const UberProgramSetup a) const

◆ operator<()

bool rr_gl::UberProgramSetup::operator< ( const UberProgramSetup a) const

◆ getComplexity()

unsigned rr_gl::UberProgramSetup::getComplexity ( ) const

◆ getProgram()

Program * rr_gl::UberProgramSetup::getProgram ( UberProgram uberProgram)

Returns uberProgram with parameter values defined by our attributes. UberProgram with parameter values defined is Program.

◆ detectMaxShadowmaps()

unsigned rr_gl::UberProgramSetup::detectMaxShadowmaps ( UberProgram uberProgram,
int  argc = 0,
const char *const *  argv = nullptr 
)

Returns the highest number of shadowmaps, that may be processed in one pass with this setup (material & lighting). The same number is set to SHADOW_MAPS.

If one of arguments in argv is penumbraX for X=1..8, X is returned.

◆ checkCapabilities()

static void rr_gl::UberProgramSetup::checkCapabilities ( )
static

Check whether number of texture image units supported by platform is high enough, warns if it isn't.

◆ validate()

void rr_gl::UberProgramSetup::validate ( )

Change invalid settings to closest valid settings.

◆ useProgram()

Program * rr_gl::UberProgramSetup::useProgram ( UberProgram uberProgram,
const rr::RRCamera camera,
RealtimeLight light,
unsigned  firstInstance,
float  lightDirectMultiplier,
const rr::RRVec4 brightness,
float  gamma,
const ClipPlanes clipPlanes 
)

Sets rendering pipeline so that following primitives are rendered by our program. Some shader parameters are left uninitialized, useIlluminationEnvMaps(), useIlluminationMirror() and useMaterial() should follow to set them.

◆ useCamera()

void rr_gl::UberProgramSetup::useCamera ( Program program,
const rr::RRCamera camera 
)

Sets shader uniform with camera settings. It is also part of useProgram(), so call it only if you don't call useProgram().

◆ useMaterial()

void rr_gl::UberProgramSetup::useMaterial ( Program program,
const rr::RRMaterial material,
float  materialEmittanceMultiplier,
float  animationTime 
) const

Sets shader uniform parameters to match given material, should be called after useProgram() or getNextPass(). You can call expensive useProgram() once and cheaper useMaterial() multiple times.

◆ useIlluminationEnvMap()

void rr_gl::UberProgramSetup::useIlluminationEnvMap ( Program program,
const rr::RRBuffer environment 
)

Sets shader illumination environment map, should be called after useProgram() or getNextPass(). You can call expensive useProgram() once and cheaper useIlluminationEnvMap() multiple times.

◆ useIlluminationMirror()

void rr_gl::UberProgramSetup::useIlluminationMirror ( Program program,
const rr::RRBuffer mirrorMap 
)

Sets shader illumination mirror map, should be called after useProgram() or getNextPass(). You can call expensive useProgram() once and cheaper useIlluminationMirror() multiple times.

◆ useWorldMatrix()

void rr_gl::UberProgramSetup::useWorldMatrix ( Program program,
const rr::RRObject object 
)

Sets world matrix for given object.

Member Data Documentation

◆ SHADOW_MAPS

unsigned char rr_gl::UberProgramSetup::SHADOW_MAPS

Number of shadow maps processed in one pass. 0=no shadows, 1=hard shadows, more=soft shadows. Valid values: 0..detectMaxShadowmaps().

◆ SHADOW_SAMPLES

unsigned char rr_gl::UberProgramSetup::SHADOW_SAMPLES

Number of samples read from each shadowmap. 0=no shadows, 1=hard shadows, 2,4,8=soft shadows. Valid values: 0,1,2,4,8.

◆ SHADOW_COLOR

bool rr_gl::UberProgramSetup::SHADOW_COLOR

Enables colored semitransparent shadows.

◆ SHADOW_PENUMBRA

bool rr_gl::UberProgramSetup::SHADOW_PENUMBRA

Enables blend of all shadowmaps, used by penumbra shadows.

◆ SHADOW_CASCADE

bool rr_gl::UberProgramSetup::SHADOW_CASCADE

Enables cascading of all shadowmaps, used by cascaded shadowmapping.

◆ SHADOW_ONLY

bool rr_gl::UberProgramSetup::SHADOW_ONLY

Renders only direct shadows without direct illumination. Must be combined with indirect illumination, shadows are subtracted from indirect light. Has no visible effect if there's no indirect light.

◆ LIGHT_DIRECT

bool rr_gl::UberProgramSetup::LIGHT_DIRECT

Enables direct light. All enabled LIGHT_DIRECT_XXX are multiplied.

◆ LIGHT_DIRECT_COLOR

bool rr_gl::UberProgramSetup::LIGHT_DIRECT_COLOR

Enables modulation of direct light by constant color.

◆ LIGHT_DIRECT_MAP

bool rr_gl::UberProgramSetup::LIGHT_DIRECT_MAP

Enables modulation of direct light by color map. Projects texture.

◆ LIGHT_DIRECTIONAL

bool rr_gl::UberProgramSetup::LIGHT_DIRECTIONAL

Switches direct light from positional (with optional dist.atten.) to directional (no dist.atten.).

◆ LIGHT_DIRECT_ATT_SPOT

bool rr_gl::UberProgramSetup::LIGHT_DIRECT_ATT_SPOT

Enables direct light spot attenuation. (You can get the same effect faster with LIGHT_DIRECT_MAP by projecting spot texture.)

◆ LIGHT_DIRECT_ATT_REALISTIC

bool rr_gl::UberProgramSetup::LIGHT_DIRECT_ATT_REALISTIC

Enables direct light realistic distance attenuation.

◆ LIGHT_DIRECT_ATT_POLYNOMIAL

bool rr_gl::UberProgramSetup::LIGHT_DIRECT_ATT_POLYNOMIAL

Enables direct light polynomial distance attenuation.

◆ LIGHT_DIRECT_ATT_EXPONENTIAL

bool rr_gl::UberProgramSetup::LIGHT_DIRECT_ATT_EXPONENTIAL

Enables direct light exponential distance attenuation.

◆ LIGHT_INDIRECT_CONST

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_CONST

Illuminates material (both diffuse and specular components) by constant ambient light. Non-directional. Always available (does not need any data buffers), but the least realistic out of all LIGHT_INDIRECT_ options.

◆ LIGHT_INDIRECT_VCOLOR

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_VCOLOR

Illuminates material's diffuse component by vertex colors (any vertex buffer you provide, or realtime radiosity calculated one). Non-directional.

◆ LIGHT_INDIRECT_VCOLOR2

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_VCOLOR2

Enables blend between two ambient vertex colors. Non-directional.

◆ LIGHT_INDIRECT_VCOLOR_LINEAR

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_VCOLOR_LINEAR

If indirect illumination by vertex colors is used, it is expected in physical/linear scale, converted to sRGB in shader.

◆ LIGHT_INDIRECT_MAP

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_MAP

Illuminates material's diffuse component by ambient map (any map you provide). Non-directional.

◆ LIGHT_INDIRECT_MAP2

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_MAP2

Enables blend between two ambient maps. Non-directional.

◆ LIGHT_INDIRECT_DETAIL_MAP

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_DETAIL_MAP

Enables modulation of indirect light by light detail map. Non-directional.

◆ LIGHT_INDIRECT_ENV_DIFFUSE

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_ENV_DIFFUSE

Illuminates material's diffuse component by environment map (any map you provide, or lowres realtime raytraced one). Affects only flat objects with environment map preallocated. Directional, works with normal maps. Recommended for all dynamic objects except for large planes, where LIGHT_INDIRECT_MIRROR_DIFFUSE produces better (but slower) results.

◆ LIGHT_INDIRECT_ENV_SPECULAR

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_ENV_SPECULAR

Illuminates material's specular component by environment map (any map you provide, or lowres realtime raytraced one). Affects only flat objects with environment map preallocated. Directional, works with normal maps. Recommended for all objects without LIGHT_INDIRECT_MIRROR_SPECULAR.

◆ LIGHT_INDIRECT_ENV_REFRACT

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_ENV_REFRACT

Modifies behaviour of MATERIAL_TRANSPARENCY_BLEND. While MATERIAL_TRANSPARENCY_BLEND without LIGHT_INDIRECT_ENV_REFRACT enables one of GPU blending modes where background is read from framebuffer and objects have to be sorted, MATERIAL_TRANSPARENCY_BLEND with LIGHT_INDIRECT_ENV_REFRACT samples background from environment map (any map you provide, or automatically raytraced lowres one) and it does not need transparent objects sorted. LIGHT_INDIRECT_ENV_REFRACT can only be enabled manually, it is not set automatically. When enabled, MATERIAL_TRANSPARENCY_TO_RGB must be disabled.

◆ LIGHT_INDIRECT_MIRROR_DIFFUSE

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_MIRROR_DIFFUSE

Illuminates material's diffuse component by realtime rasterized highres mirror reflection. Affects only flat objects without environment map. Directional, works with normal maps. Recommended for all large dynamic planes (as a slower but higher quality option). Small dynamic planes look better with LIGHT_INDIRECT_ENV_DIFFUSE, static planes look better with LIGHT_INDIRECT_VCOLOR(unless number of vertices is very low) or LIGHT_INDIRECT_MAP.

◆ LIGHT_INDIRECT_MIRROR_SPECULAR

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_MIRROR_SPECULAR

Illuminates material's specular component by realtime rasterized highres mirror reflection. Affects only flat objects without environment map. Directional, works with normal maps. Recommended for all planes (as a slower but higher quality option), except for very small ones, where much faster LIGHT_INDIRECT_ENV_SPECULAR might be good enough. (If you don't see mirroring, is specularEnvMap nullptr? Is volume of mesh AABB zero? Object can be arbitrarily rotated, but original mesh before rotation must be axis aligned.)

◆ LIGHT_INDIRECT_MIRROR_MIPMAPS

bool rr_gl::UberProgramSetup::LIGHT_INDIRECT_MIRROR_MIPMAPS

Enables higher quality mirroring (builds lightIndirectMirrorMap with mipmaps).

◆ MATERIAL_DIFFUSE

bool rr_gl::UberProgramSetup::MATERIAL_DIFFUSE

Enables material's diffuse reflection. All enabled MATERIAL_DIFFUSE_XXX are multiplied. When only MATERIAL_DIFFUSE is enabled, diffuse color is 1 (white).

◆ MATERIAL_DIFFUSE_X2

bool rr_gl::UberProgramSetup::MATERIAL_DIFFUSE_X2

Enables material's diffuse reflectance multiplied by 2. (used by Quake3 engine scenes)

◆ MATERIAL_DIFFUSE_CONST

bool rr_gl::UberProgramSetup::MATERIAL_DIFFUSE_CONST

Enables material's diffuse reflectance modulated by constant color.

◆ MATERIAL_DIFFUSE_MAP

bool rr_gl::UberProgramSetup::MATERIAL_DIFFUSE_MAP

Enables material's diffuse reflectance modulated by diffuse map.

◆ MATERIAL_SPECULAR

bool rr_gl::UberProgramSetup::MATERIAL_SPECULAR

Enables material's specular reflectance. All enabled MATERIAL_SPECULAR_XXX are multiplied. When only MATERIAL_SPECULAR is enabled, specular color is 1 (white).

◆ MATERIAL_SPECULAR_CONST

bool rr_gl::UberProgramSetup::MATERIAL_SPECULAR_CONST

Enables material's specular reflectance modulated by constant color.

◆ MATERIAL_SPECULAR_MAP

bool rr_gl::UberProgramSetup::MATERIAL_SPECULAR_MAP

Enables material's specular reflectance and shininess modulated by specular map (reflectance is read from RGB, material's shininess is modulated by A).

◆ MATERIAL_SPECULAR_MODEL

unsigned char rr_gl::UberProgramSetup::MATERIAL_SPECULAR_MODEL

Copy of specularModel from material.

◆ MATERIAL_EMISSIVE_CONST

bool rr_gl::UberProgramSetup::MATERIAL_EMISSIVE_CONST

Enables material's emission stored in constant. All enabled MATERIAL_EMISSIVE_XXX are accumulated.

◆ MATERIAL_EMISSIVE_MAP

bool rr_gl::UberProgramSetup::MATERIAL_EMISSIVE_MAP

Enables material's emission stored in sRGB map.

◆ MATERIAL_TRANSPARENCY_CONST

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_CONST

Enables materials's specular transmittance modulated by constant.

◆ MATERIAL_TRANSPARENCY_MAP

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_MAP

Enables materials's specular transmittance modulated by texture (rgb or alpha). Optimization: with diffuse map enabled and transparency in its alpha, set only MATERIAL_TRANSPARENCY_IN_ALPHA, not MATERIAL_TRANSPARENCY_MAP.

◆ MATERIAL_TRANSPARENCY_IN_ALPHA

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_IN_ALPHA

If(!MATERIAL_TRANSPARENCY_CONST && !MATERIAL_TRANSPARENCY_MAP), enables materials's specular transmittance modulated by diffuse alpha (0=transparent), otherwise makes transparency read from alpha (0=transparent) rather than from rgb (1=transparent).

◆ MATERIAL_TRANSPARENCY_NOISE

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_NOISE

When alpha keying (1bit transparency), don't use simple cutoff, simulate blending with spatial noise.

◆ MATERIAL_TRANSPARENCY_BLEND

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_BLEND

When rendering transparency, don't use alpha keying (0% or 100% transparency); mix background into final color. This is implemented either by one of GPU blending modes or by refraction (LIGHT_INDIRECT_ENV_REFRACT) where background is sampled from object's cubemap rather than from framebuffer.

◆ MATERIAL_TRANSPARENCY_TO_RGB

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_TO_RGB

When blending (MATERIAL_TRANSPARENCY_BLEND) without refraction (LIGHT_INDIRECT_ENV_REFRACT), uses more realistic RGB blending rather than usual alpha blending. When not blending, transparency color is just sent to RGB instead of A (this mode must not be combined with diffuse/specular/emis because they also write to RGB). Don't set when rendering refraction (LIGHT_INDIRECT_ENV_REFRACT).

◆ MATERIAL_TRANSPARENCY_FRESNEL

bool rr_gl::UberProgramSetup::MATERIAL_TRANSPARENCY_FRESNEL

Turns small fraction of specular transmittance and MATERIAL_EMISSIVE_CONST into specular reflectance, decreasing transmittance+emittance, increasing reflectance. Including emittance seems wrong, but materials of deep water surface simulate transmittance+scattering(some photons going back) with constant emittance. If you don't see effects in realtime, check: 1) RRMaterial::refractionIndex!=1 (for refractionIndex converging to 1, images with Fresnel converge to images without Fresnel, this is correctly simulated). 2) MATERIAL_TRANSPARENCY_BLEND enabled (small transparency change would be hardly visible with 1-bit keying). 3) For increase in reflectance to be visible, MATERIAL_SPECULAR should be enabled (otherwise you see only reduced transmittance/emittance). 4) Also for reflectance to be visible, LIGHT_INDIRECT_ENV_SPECULAR is recommended. Then environment map for LIGHT_INDIRECT_ENV_SPECULAR must be available. If you allocate it with allocateBuffersForRealtimeGI() (rather than manually), make sure that allocation does not fails because of thresholds.

◆ MATERIAL_BUMP_MAP

bool rr_gl::UberProgramSetup::MATERIAL_BUMP_MAP

Enables normal map or height map, each pixel's normal is modulated by contents of map.

◆ MATERIAL_BUMP_TYPE_HEIGHT

bool rr_gl::UberProgramSetup::MATERIAL_BUMP_TYPE_HEIGHT

Switches bump mapping code from default normal maps to height maps (height maps need additional code to calculate normals).

◆ MATERIAL_NORMAL_MAP_FLOW

bool rr_gl::UberProgramSetup::MATERIAL_NORMAL_MAP_FLOW

When using normal map, enables flow of normal map over geometry, simulating flow of waves on large water surface.

◆ MATERIAL_CULLING

bool rr_gl::UberProgramSetup::MATERIAL_CULLING

Enables materials's n-sided property (culling is enabled/disabled according to material). false = treat everything as 2sided.

◆ ANIMATION_WAVE

bool rr_gl::UberProgramSetup::ANIMATION_WAVE

Enables simple procedural deformation, only to demonstrate that lighting supports animations.

◆ POSTPROCESS_NORMALS

bool rr_gl::UberProgramSetup::POSTPROCESS_NORMALS

Renders normal values instead of colors.

◆ POSTPROCESS_BRIGHTNESS

bool rr_gl::UberProgramSetup::POSTPROCESS_BRIGHTNESS

Enables brightness correction of final color (before gamma). 1 = instructions always included in shader = fewer shader versions = faster startup. 0 = instructions removed from shader when not needed, more shaders to compile but possibly higher fps.

◆ POSTPROCESS_GAMMA

bool rr_gl::UberProgramSetup::POSTPROCESS_GAMMA

Enables gamma correction of final color (after brightness). 1 = instructions always included in shader = fewer shader versions = faster startup. 0 = instructions removed from shader when not needed, more shaders to compile but possibly higher fps.

◆ POSTPROCESS_BIGSCREEN

bool rr_gl::UberProgramSetup::POSTPROCESS_BIGSCREEN

Simulates effect of party projected bigscreen with ambient light.

◆ OBJECT_SPACE

bool rr_gl::UberProgramSetup::OBJECT_SPACE

Enables positions in object space, vertices are transformed by uniform worldMatrix. Without OBJECT_SPACE, objects are rendered in their local spaces, you may get all objects stacked in world center.

◆ CLIP_PLANE

bool rr_gl::UberProgramSetup::CLIP_PLANE

Discards geometry with pos . clipPlane<=0.

◆ CLIP_PLANE_XA

bool rr_gl::UberProgramSetup::CLIP_PLANE_XA

Discards geometry with x>clipPlaneXA.

◆ CLIP_PLANE_XB

bool rr_gl::UberProgramSetup::CLIP_PLANE_XB

Discards geometry with x<clipPlaneXB.

◆ CLIP_PLANE_YA

bool rr_gl::UberProgramSetup::CLIP_PLANE_YA

Discards geometry with y>clipPlaneYA.

◆ CLIP_PLANE_YB

bool rr_gl::UberProgramSetup::CLIP_PLANE_YB

Discards geometry with y<clipPlaneYB.

◆ CLIP_PLANE_ZA

bool rr_gl::UberProgramSetup::CLIP_PLANE_ZA

Discards geometry with z>clipPlaneZA.

◆ CLIP_PLANE_ZB

bool rr_gl::UberProgramSetup::CLIP_PLANE_ZB

Discards geometry with z<clipPlaneZB.

◆ FORCE_2D_POSITION

bool rr_gl::UberProgramSetup::FORCE_2D_POSITION

Overrides projection space vertex coordinates with coordinates read from texcoord7 channel. Triangles are lit as if they stay on their original positions, but they are rendered to externally set positions in texture.

◆ LEGACY_GL

bool rr_gl::UberProgramSetup::LEGACY_GL

Uses legacy built-in variables gl_Vertex, gl_Color and gl_ModelViewProjectionMatrix. For compatibility with 3rd party legacy rendering code.

◆ comment

const char* rr_gl::UberProgramSetup::comment

Comment added to shader. Must start with //. Not freed.