#include <FlatShader.hpp>

Classes

struct  Params
 

Public Types

enum  FittingStage { FittingStage::None }
 
enum  PixelizeStage { PixelizeStage::None, PixelizeStage::Squares, PixelizeStage::Circles }
 
enum  ResizeStage { ResizeStage::Scale, ResizeStage::Fixed, ResizeStage::Repeat, ResizeStage::Frame }
 
enum  FilteringStage {
  FilteringStage::Plain, FilteringStage::Msdf, FilteringStage::AlphaThreshold, FilteringStage::AlphaThresholdWidth,
  FilteringStage::AlphaThresholdWidthSmooth
}
 

Public Member Functions

 FlatShader (Instance *inst, VirtualResourceProvider const *, FlatShader_Subprovider const *, ResourcePath const &path)
 
GLuint program_id () const
 
void Render (ClientMarker const &log_target, CameraState const &camera, std::optional< float > depth_override, float4x4 const &model, ShaderScissor const &scissor, float4 preblend, bool translucent, GlMesh const *mesh, float3 mesh_resize, float2 mesh_texcoord_density, GlTexture const *texture, float texture_density_rel, float texture_msdf_pixelRange, Params const &params) const
 
Instanceinstance () const
 

Public Attributes

ClientMarker cm
 

Detailed Description

Definition at line 70 of file FlatShader.hpp.

Member Enumeration Documentation

◆ FittingStage

Enumerator
None 

Definition at line 73 of file FlatShader.hpp.

◆ PixelizeStage

Enumerator
None 
Squares 
Circles 

Definition at line 78 of file FlatShader.hpp.

◆ ResizeStage

Enumerator
Scale 
Fixed 
Repeat 
Frame 

Definition at line 85 of file FlatShader.hpp.

◆ FilteringStage

Enumerator
Plain 
Msdf 
AlphaThreshold 
AlphaThresholdWidth 
AlphaThresholdWidthSmooth 

Similar to AlphaThresholdWidth, but only center of active alpha range will be fully visible, the farther from center, the lower alpha the fragment will have.

Definition at line 93 of file FlatShader.hpp.

Constructor & Destructor Documentation

◆ FlatShader()

iv::FlatShader::FlatShader ( Instance inst,
VirtualResourceProvider const *  ,
FlatShader_Subprovider const *  ,
ResourcePath const &  path 
)

Definition at line 75 of file FlatShader.cpp.

Member Function Documentation

◆ program_id()

GLuint iv::FlatShader::program_id ( ) const

Contains 0 if shader is not currently loaded into gpu (gpu is disabled).

Definition at line 87 of file FlatShader.cpp.

◆ Render()

void iv::FlatShader::Render ( ClientMarker const &  log_target,
CameraState const &  camera,
std::optional< float >  depth_override,
float4x4 const &  model,
ShaderScissor const &  scissor,
float4  preblend,
bool  translucent,
GlMesh const *  mesh,
float3  mesh_resize,
float2  mesh_texcoord_density,
GlTexture const *  texture,
float  texture_density_rel,
float  texture_msdf_pixelRange,
Params const &  params 
) const
Parameters
log_target
target
camera
mesh
mesh_resizeResizes input mesh. Moves all vertices by multiplying their position by this parameter. This scales the texture if the texture_resize stays the same. If we scale texture_resize simultaneously with vertex_pos_mul, then the texture render is just resized (not relevant for ResizeStage::Scale, because that one scales either way).
mesh_texcoord_densityHow many texcoords there are on average per distance of 1 in position units (mesh local units). Used in pixelize stage and maybe in Msdf for smoothing, not needed in other cases. NOTE - This should probably be float3 and should be texel density in three dimensions of the mesh. It wouldn't change nothing in 2D meshes, but will make more sense and might be somewhat useful on 3D meshes. But there is no need until we can test it on something that is in fact useful.
texture
texture_density_reltexture density / screen density
texture_msdf_pixelRangeUsed when FilteringStage is msdf.
preblendAlpha is usualy 0 to skip preblending or 255 to apply preblending. Values in between will apply partial preblending, which can possibly be used as a visual effect (very subtle glow on smoothed renders). All translucent texels are blended on top given preblend color.
translucentTranslucent pixels that were not solidified with preblend will be solidified (alpha set to 1 or discard) according to Params::alpha parameter.
model
scissor
params

Definition at line 143 of file FlatShader.cpp.

◆ instance()

Instance * iv::GlInfo::instance

Definition at line 90 of file GlSystem.cpp.

Member Data Documentation

◆ cm

ClientMarker iv::FlatShader::cm

Definition at line 138 of file FlatShader.hpp.


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