libgpac
Documentation of the core library of GPAC
raster3d.c File Reference
#include "rast_soft.h"
+ Include dependency graph for raster3d.c:

Macros

#define float_clamp(_val, _minval, _maxval)    (_val<_minval) ? _minval : (_val>_maxval) ? _maxval : _val;
 
#define GETVEC(_name, _idx)
 

Functions

static float edgeFunction (const GF_Vec4 *a, const GF_Vec4 *b, const GF_Vec4 *c)
 
float edgeFunction_pre (const GF_Vec4 *a, const Float b_minus_a_x, const Float b_minus_a_y, const GF_Vec4 *c)
 
static GFINLINE Bool evg3d_persp_divide (GF_Vec4 *pt)
 
static GFINLINE void evg_ndc_to_raster (GF_EVGSurface *surf, GF_Vec4 *pt, TPos *x, TPos *y)
 
static GFINLINE int gray3d_move_to (GF_EVGSurface *surf, TPos x, TPos y)
 
GF_Err evg_raster_render_path_3d (GF_EVGSurface *surf)
 
void evg_get_fragment (GF_EVGSurface *surf, EVGRasterCtx *rctx, Bool *is_transparent)
 
static void push_patch_pixel (AAScanline *sl, s32 x, u32 col, u8 coverage, Float depth, Float write_depth, u32 idx1, u32 idx2)
 
static PatchPixelget_patch_pixel (AAScanline *sl, s32 x)
 
static void remove_patch_pixel (AAScanline *sl, s32 x)
 
void EVG3D_SpanFunc (int y, int count, EVG_Span *spans, GF_EVGSurface *surf, EVGRasterCtx *rctx)
 
static GFINLINE Bool precompute_tri (GF_EVGSurface *surf, GF_EVGFragmentParam *fparam, TPos xmin, TPos xmax, TPos ymin, TPos ymax, TPos _x1, TPos _y1, TPos _x2, TPos _y2, TPos _x3, TPos _y3, GF_Vec4 *s_pt1, GF_Vec4 *s_pt2, GF_Vec4 *s_pt3, u32 vidx1, u32 vidx2, u32 vidx3)
 
GF_Err evg_raster_render3d (GF_EVGSurface *surf, u32 *indices, u32 nb_idx, Float *vertices, u32 nb_vertices, u32 nb_comp, GF_EVGPrimitiveType prim_type)
 
GF_Err evg_raster_render3d_path (GF_EVGSurface *surf, GF_Path *path, Float z)
 
GF_EXPORT GF_Err gf_evg_surface_clear_depth (GF_EVGSurface *surf, Float depth)
 
GF_EXPORT GF_Err gf_evg_surface_viewport (GF_EVGSurface *surf, u32 x, u32 y, u32 w, u32 h)
 
static Bool depth_test_never (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_always (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_less (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_less_equal (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_equal (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_greater (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_greater_equal (Float depth_buf_value, Float frag_value)
 
static Bool depth_test_not_equal (Float depth_buf_value, Float frag_value)
 
GF_EXPORT GF_Err gf_evg_set_depth_test (GF_EVGSurface *surf, GF_EVGDepthTest mode)
 
GF_Err evg_3d_update_depth_range (GF_EVGSurface *surf)
 
EVG_Surface3DExtevg_init_3d_surface (GF_EVGSurface *surf)
 
GF_Err gf_evg_surface_set_fragment_shader (GF_EVGSurface *surf, gf_evg_fragment_shader shader, gf_evg_fragment_shader_init shader_init, void *shader_udta)
 
GF_Err gf_evg_surface_disable_early_depth (GF_EVGSurface *surf, Bool disable)
 
GF_Err gf_evg_surface_set_vertex_shader (GF_EVGSurface *surf, gf_evg_vertex_shader shader, void *shader_udta)
 
GF_Err gf_evg_surface_set_ccw (GF_EVGSurface *surf, Bool is_ccw)
 
GF_Err gf_evg_surface_set_backcull (GF_EVGSurface *surf, Bool backcull)
 
GF_Err gf_evg_surface_set_antialias (GF_EVGSurface *surf, Bool antialias)
 
GF_Err gf_evg_surface_set_min_depth (GF_EVGSurface *surf, Float min_depth)
 
GF_Err gf_evg_surface_set_max_depth (GF_EVGSurface *surf, Float max_depth)
 
GF_Err gf_evg_surface_set_clip_zero (GF_EVGSurface *surf, Bool clip_zero)
 
GF_Err gf_evg_surface_set_point_size (GF_EVGSurface *surf, Float size)
 
GF_Err gf_evg_surface_set_line_size (GF_EVGSurface *surf, Float size)
 
GF_Err gf_evg_surface_set_point_smooth (GF_EVGSurface *surf, Bool smooth)
 
GF_Err gf_evg_surface_write_depth (GF_EVGSurface *surf, Bool do_write)
 
GF_Err gf_evg_surface_set_depth_buffer (GF_EVGSurface *surf, Float *depth)
 

Macro Definition Documentation

◆ float_clamp

#define float_clamp (   _val,
  _minval,
  _maxval 
)     (_val<_minval) ? _minval : (_val>_maxval) ? _maxval : _val;

◆ GETVEC

#define GETVEC (   _name,
  _idx 
)
Value:
vx->x = vertices[_idx];\
vx->y = vertices[_idx+1];\
if (_idx+nb_comp_1>=nb_vertices) return GF_BAD_PARAM;\
vx->z = (nb_comp>2) ? vertices[_idx+2] : 0.0f;\
vx->q = 1.0;\
if (s3d->vert_shader) {\
s3d->vert_shader(s3d->vert_shader_udta, &vparam); \
s_##_name = vparam.out_vertex;\
} else {\
s_##_name.x = vx->x;\
s_##_name.y = vx->y;\
s_##_name.z = vx->z;\
s_##_name.q = 1;\
gf_mx_apply_vec_4x4(&projModeView, &s_##_name);\
}\
if (!evg3d_persp_divide(&s_##_name)) continue;\
@ GF_BAD_PARAM
Definition: tools.h:135
static GFINLINE Bool evg3d_persp_divide(GF_Vec4 *pt)
Definition: raster3d.c:67

Function Documentation

◆ edgeFunction()

static float edgeFunction ( const GF_Vec4 a,
const GF_Vec4 b,
const GF_Vec4 c 
)
static
+ Here is the caller graph for this function:

◆ edgeFunction_pre()

float edgeFunction_pre ( const GF_Vec4 a,
const Float  b_minus_a_x,
const Float  b_minus_a_y,
const GF_Vec4 c 
)
+ Here is the caller graph for this function:

◆ evg3d_persp_divide()

static GFINLINE Bool evg3d_persp_divide ( GF_Vec4 pt)
static
+ Here is the caller graph for this function:

◆ evg_ndc_to_raster()

static GFINLINE void evg_ndc_to_raster ( GF_EVGSurface *  surf,
GF_Vec4 pt,
TPos x,
TPos y 
)
static
+ Here is the caller graph for this function:

◆ gray3d_move_to()

static GFINLINE int gray3d_move_to ( GF_EVGSurface *  surf,
TPos  x,
TPos  y 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ evg_raster_render_path_3d()

GF_Err evg_raster_render_path_3d ( GF_EVGSurface *  surf)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ evg_get_fragment()

void evg_get_fragment ( GF_EVGSurface *  surf,
EVGRasterCtx *  rctx,
Bool is_transparent 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ push_patch_pixel()

static void push_patch_pixel ( AAScanline sl,
s32  x,
u32  col,
u8  coverage,
Float  depth,
Float  write_depth,
u32  idx1,
u32  idx2 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_patch_pixel()

static PatchPixel* get_patch_pixel ( AAScanline sl,
s32  x 
)
static
+ Here is the caller graph for this function:

◆ remove_patch_pixel()

static void remove_patch_pixel ( AAScanline sl,
s32  x 
)
static
+ Here is the caller graph for this function:

◆ EVG3D_SpanFunc()

void EVG3D_SpanFunc ( int  y,
int  count,
EVG_Span spans,
GF_EVGSurface *  surf,
EVGRasterCtx *  rctx 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ precompute_tri()

static GFINLINE Bool precompute_tri ( GF_EVGSurface *  surf,
GF_EVGFragmentParam fparam,
TPos  xmin,
TPos  xmax,
TPos  ymin,
TPos  ymax,
TPos  _x1,
TPos  _y1,
TPos  _x2,
TPos  _y2,
TPos  _x3,
TPos  _y3,
GF_Vec4 s_pt1,
GF_Vec4 s_pt2,
GF_Vec4 s_pt3,
u32  vidx1,
u32  vidx2,
u32  vidx3 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ evg_raster_render3d()

GF_Err evg_raster_render3d ( GF_EVGSurface *  surf,
u32 indices,
u32  nb_idx,
Float vertices,
u32  nb_vertices,
u32  nb_comp,
GF_EVGPrimitiveType  prim_type 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ evg_raster_render3d_path()

GF_Err evg_raster_render3d_path ( GF_EVGSurface *  surf,
GF_Path path,
Float  z 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ depth_test_never()

static Bool depth_test_never ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_always()

static Bool depth_test_always ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_less()

static Bool depth_test_less ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_less_equal()

static Bool depth_test_less_equal ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_equal()

static Bool depth_test_equal ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_greater()

static Bool depth_test_greater ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_greater_equal()

static Bool depth_test_greater_equal ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ depth_test_not_equal()

static Bool depth_test_not_equal ( Float  depth_buf_value,
Float  frag_value 
)
static
+ Here is the caller graph for this function:

◆ evg_3d_update_depth_range()

GF_Err evg_3d_update_depth_range ( GF_EVGSurface *  surf)
+ Here is the caller graph for this function:

◆ evg_init_3d_surface()

EVG_Surface3DExt* evg_init_3d_surface ( GF_EVGSurface *  surf)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: