FastUIDraw
Functions | Variables
GLSL Vertex Code

This group documents the GLSL functions fastuidraw makes available to GLSL code fragments for only vertex shading for custom shading as embodied by the classes fastuidraw::glsl::PainterItemShaderGLSL, fastuidraw::glsl::PainterBlendShaderGLSL and fastuidraw::glsl::PainterBrushShaderGLSL. More...

Functions

vec2 fastuidraw_align_normal_to_screen (in vec3 clip_p, in vec2 n)
 
float fastuidraw_local_distance_from_pixel_distance (in float pixel_distance, in vec3 clip_p, in vec3 clip_direction)
 

Variables

mat3 fastuidraw_item_matrix
 

Detailed Description

This group documents the GLSL functions fastuidraw makes available to GLSL code fragments for only vertex shading for custom shading as embodied by the classes fastuidraw::glsl::PainterItemShaderGLSL, fastuidraw::glsl::PainterBlendShaderGLSL and fastuidraw::glsl::PainterBrushShaderGLSL.

Function Documentation

◆ fastuidraw_align_normal_to_screen()

vec2 fastuidraw_align_normal_to_screen ( in vec3  clip_p,
in vec2  n 
)

Given a normal vector in local coordinate and a position in -clip- coordinates, return the vector N in local coordinates so that N transformed to screen coordiantes is perpindicular to the vector T transformed to screen coordinate where T is the vector perpindicular to the input normal vector. The magnitude of N is not necessarily the same as the magnitude of the input vector n, only the nature of its direction is guarnateed.

Parameters
clip_pposition in CLIP coordinates
nnormal vector in LOCAL coordinates

Definition at line 56 of file fastuidraw_align.vert.glsl.hpp.

◆ fastuidraw_local_distance_from_pixel_distance()

float fastuidraw_local_distance_from_pixel_distance ( in float  pixel_distance,
in vec3  clip_p,
in vec3  clip_direction 
)

Given a point (clip_p) and a direction (clip_direction) in clip-coordinates, compute the coeffecient W so that AFTER projection, the points clip_p and (clip_p + W * clip_direction) are pixel_distance pixels apart.

Parameters
pixel_distancethe distance in pixels to move by
clip_pthe position of the vertex in CLIP coordiantes
clip_directionthe direction by which to move in CLIP coordiantes

Definition at line 34 of file fastuidraw_compute_local_distance_from_pixel_distance.glsl.hpp.

Variable Documentation

◆ fastuidraw_item_matrix

mat3 fastuidraw_item_matrix

Gives the 3x3 transformation matrix from local item coordiantes to clip-coordinates as clip_coordinates.xyz = fastuidraw_item_matrix * vec3(item_coordinates.xy, 1.0)

Definition at line 28 of file fastuidraw_painter_globals.vert.glsl.hpp.