#include <FlatShader.hpp>
|
| 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 ¶ms) const |
|
Instance * | instance () const |
|
Definition at line 70 of file FlatShader.hpp.
◆ FittingStage
◆ PixelizeStage
◆ 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.
◆ FlatShader()
◆ 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_resize | Resizes 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_density | How 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_rel | texture density / screen density |
texture_msdf_pixelRange | Used when FilteringStage is msdf. |
preblend | Alpha 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. |
translucent | Translucent 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()
◆ cm
The documentation for this class was generated from the following files: