53 Detail_level_locked(-1),
60 Replacement_textures(NULL),
61 Team_color_set(
false),
62 Clip_plane_set(
false),
67 Warp_scale.
xyz.x = 1.0f;
68 Warp_scale.
xyz.y = 1.0f;
69 Warp_scale.
xyz.z = 1.0f;
99 return Detail_level_locked;
128 return Xparent_alpha;
133 return Forced_bitmap;
138 return Insignia_bitmap;
143 return Replacement_textures;
148 return Current_team_color;
163 return Animated_effect;
168 return Animated_timer;
173 Animated_effect = effect_num;
174 Animated_timer = timer;
179 Clip_plane_set =
true;
181 Clip_normal = normal;
187 return Clip_plane_set;
192 Team_color_set =
true;
194 Current_team_color = clr;
199 Team_color_set =
model_get_team_color(&Current_team_color, team, secondaryteam, timestamp, fadetime);
204 return Team_color_set;
224 Xparent_alpha =
alpha;
266 Detail_level_locked = detail_level_lock;
271 Thruster_info = info;
278 return Thruster_info;
283 Submodel_matrices.clear();
292 memset(&init_mat, 0,
sizeof(
matrix4));
294 init_mat.
a1d[0] = 1.0f;
295 init_mat.
a1d[5] = 1.0f;
296 init_mat.
a1d[10] = 1.0f;
297 init_mat.
a1d[15] = 1.0f;
299 Current_offset = Submodel_matrices.size();
301 for (
int i = 0;
i < n_models; ++
i ) {
302 Submodel_matrices.push_back(init_mat);
308 Submodel_matrices[Current_offset + model_id] =
transform;
313 Submodel_matrices.push_back(mat);
318 return Current_offset;
321 void model_batch_buffer::allocate_memory()
325 if ( Mem_alloc == NULL || Mem_alloc_size < size ) {
326 if ( Mem_alloc != NULL ) {
333 Mem_alloc_size =
size;
334 memcpy(Mem_alloc, &Submodel_matrices[0], size);
339 if ( Submodel_matrices.size() == 0 ) {
355 Current_set_clip_plane = -1;
357 Dirty_render_state =
true;
369 Render_states.clear();
370 Render_elements.clear();
375 Current_scale.
xyz.x = 1.0f;
376 Current_scale.
xyz.y = 1.0f;
377 Current_scale.
xyz.z = 1.0f;
380 void draw_list::sort_draws()
383 std::sort(Target->Render_keys.begin(), Target->Render_keys.end(), draw_list::sort_draw_pair);
395 memset(&transform, 0,
sizeof(
matrix4));
398 transform.
a1d[0] = Current_transform.
basis.
a1d[0] * Current_scale.
xyz.x;
403 transform.
a1d[5] = Current_transform.
basis.
a1d[4] * Current_scale.
xyz.y;
408 transform.
a1d[10] = Current_transform.
basis.
a1d[8] * Current_scale.
xyz.z;
416 transform.
a1d[15] = 0.0f;
427 Current_depth_mode = depth_set;
439 new_arc.
width = arc_width;
441 Arcs.push_back(new_arc);
448 Dirty_render_state =
true;
461 clip_normal.
point = position;
462 clip_normal.
normal = normal;
464 Clip_planes.push_back(clip_normal);
483 Render_states.push_back(Current_render_state);
486 Dirty_render_state =
false;
492 draw_data.
texi = texi;
493 draw_data.
flags = tmap_flags;
496 draw_data.
alpha = Current_alpha;
510 draw_data.
scale = Current_scale;
521 draw_data.
sdr_flags = determine_shader_flags(&Current_render_state, &draw_data, buffer, tmap_flags);
523 Render_elements.push_back(draw_data);
525 Render_keys.push_back(Render_elements.size() - 1);
532 bool use_thrust_scale =
false;
539 use_thrust_scale =
true;
565 render_state &draw_state = Render_states[render_state_num];
569 if ( Current_set_clip_plane >= 0 ) {
580 Current_set_clip_plane = -1;
668 Transform_stack.clear();
676 if ( orient == NULL ) {
688 if ( Transform_stack.size() == 0 ) {
689 Current_transform.
basis = basis;
690 Current_transform.
origin = origin;
692 Transform_stack.push_back(Current_transform);
698 transform newTransform = Current_transform;
705 Current_transform = newTransform;
706 Transform_stack.push_back(Current_transform);
711 Assert( Transform_stack.size() > 0 );
713 Transform_stack.pop_back();
715 if ( Transform_stack.size() > 0 ) {
716 Current_transform = Transform_stack.back();
724 if ( scale == NULL ) {
725 Current_scale.
xyz.x = 1.0f;
726 Current_scale.
xyz.y = 1.0f;
727 Current_scale.
xyz.z = 1.0f;
731 Current_scale = *
scale;
752 Current_blend_filter =
filter;
753 Current_alpha =
alpha;
758 Assert(texture_type > -1);
761 Current_textures[texture_type] = texture_handle;
776 Current_render_state.
lighting = lighting;
782 Current_render_state.
tm_color = clr;
792 Current_render_state.
clr = clr;
812 Current_render_state.
fog_mode = fog_mode;
813 Current_render_state.
r =
r;
814 Current_render_state.
g =
g;
815 Current_render_state.
b =
b;
816 Current_render_state.
fog_near = fog_near;
817 Current_render_state.
fog_far = fog_far;
840 TransformBufferHandler.
reset();
856 for (
size_t i = 0;
i < Render_keys.size(); ++
i ) {
857 int render_index = Render_keys[
i];
859 if ( depth_mode == -1 || Render_elements[render_index].depth_mode == depth_mode ) {
860 render_buffer(Render_elements[render_index]);
864 if ( Current_set_clip_plane >= 0 ) {
884 for (
size_t i = 0;
i < Arcs.size(); ++
i ) {
896 new_insignia.
pm =
pm;
902 Insignias.push_back(new_insignia);
931 for (
size_t i = 0;
i < Insignias.size(); ++
i ) {
932 render_insignia(Insignias[
i]);
945 draw_info.
clr = *clr;
948 Outlines.push_back(draw_info);
956 for (
size_t i = 0;
i < Outlines.size(); ++
i ) {
957 render_outline(Outlines[
i]);
963 void draw_list::render_outline(
outline_draw &outline_info)
974 bool draw_list::sort_draw_pair(
const int a,
const int b)
1033 color primary, secondary;
1038 const int AR2 = 128;
1039 const int AG2 = 128;
1049 if ( !Interp_lightning ) {
1054 if ( pm->
rad < 500.0f ) {
1055 width *= (pm->
rad * 0.01f);
1057 if ( width < 0.2
f ) {
1062 for ( i = 0; i < sm->
num_arcs; i++ ) {
1067 if ( (rand()>>4) & 1 ) {
1078 if ( (rand()>>4) & 1 ) {
1101 if ( detail_level_locked < 0 ) {
1141 if ( detail_level_locked >= 0 ) {
1142 i = detail_level_locked+1;
1145 #if MAX_DETAIL_LEVEL != 4
1146 #error Code in modelrender.cpp assumes MAX_DETAIL_LEVEL == 4
1160 int detail_level = i - 1 - tmp_detail_level;
1162 if ( detail_level < 0 ) {
1168 return detail_level;
1185 Assert(detail_level >= 0);
1187 if ( (mn >= 0) && (mn < pm->n_models) ) {
1195 if ( render_as_thruster ) {
1224 int forced_texture = -2;
1225 float forced_alpha = 1.0f;
1234 }
else if ( render_as_thruster ) {
1238 forced_texture = -1;
1241 forced_alpha = 1.2f;
1248 int texture_maps[
TM_NUM_TYPES] = {-1, -1, -1, -1, -1, -1};
1249 size_t buffer_size = buffer->
tex_buf.size();
1252 for (
size_t i = 0;
i < buffer_size;
i++ ) {
1253 int tmap_num = buffer->
tex_buf[
i].texture;
1266 if (forced_texture != -2) {
1268 alpha = forced_alpha;
1269 }
else if ( !no_texturing ) {
1274 }
else if ( (replacement_textures != NULL) && (replacement_textures[rt_begin_index +
TM_BASE_TYPE] >= 0) ) {
1291 if ( (replacement_textures != NULL) && (replacement_textures[rt_begin_index +
TM_GLOW_TYPE] >= 0) ) {
1311 if (replacement_textures != NULL) {
1317 if (replacement_textures[rt_begin_index +
TM_NORMAL_TYPE] >= 0) {
1322 if (replacement_textures[rt_begin_index +
TM_HEIGHT_TYPE] >= 0) {
1327 if (replacement_textures[rt_begin_index +
TM_MISC_TYPE] >= 0) {
1339 alpha = forced_alpha;
1343 if ( (replacement_textures != NULL) && (replacement_textures[rt_begin_index +
TM_BASE_TYPE] >= 0) ) {
1356 if ( (texture_maps[
TM_BASE_TYPE] == -1) && !no_texturing ) {
1360 uint alpha_flag = 0;
1372 blend_filter = forced_blend_filter;
1379 if ( (model_flags &
MR_NO_ZBUFFER) || (model_flags & MR_ALL_XPARENT) ) {
1404 if ( (mn < 0) || (mn >= pm->
n_models) ) {
1412 if ( pmi != NULL ) {
1416 if ( smi != NULL ) {
1445 if ( smi != NULL ) {
1517 if ( temp_light > 1.0
f ) {
1530 float box_scale = 1.2f;
1558 fix base_frametime = 0;
1560 if ( objnum >= 0 ) {
1570 return base_frametime;
1719 if ( set_autocen ) {
1723 if (is_outlines_only_htl) {
1748 float fog_near, fog_far;
1755 unsigned char r,
g,
b;
1785 if ( set_autocen ) {
1800 vec3d submodel_static_offset;
1801 bool submodel_rotation =
false;
1806 submodel_rotation =
true;
1809 if ( submodel_rotation ) {
1810 vm_vec_sub(&loc_offset, &gpt->
pnt, &submodel_static_offset);
1821 if ( shipp != NULL ) {
1823 vec3d warp_pnt, tmp;
1836 vec3d warp_pnt, tmp;
1853 float d,pulse = 1.0f;
1895 if (use_depth_buffer)
1950 if( x > period / 2) {
1955 if( x > period / 4) {
1967 vec3d cone_dir_model;
1968 vec3d cone_dir_world;
1969 vec3d cone_dir_screen;
1981 cone_dir_screen.
xyz.z = -cone_dir_screen.
xyz.z;
1982 light_add_cone(&world_pnt, &cone_dir_screen, gpo->
cone_angle, gpo->
cone_inner_angle, gpo->
dualcone, 1.0f, w * gpo->
radius_multi, 1, pulse * gpo->
light_color.
xyz.x + (1.0f-pulse) * gpo->
light_mix_color.
xyz.x, pulse * gpo->
light_color.
xyz.y + (1.0f-pulse) * gpo->
light_mix_color.
xyz.y, pulse * gpo->
light_color.
xyz.z + (1.0f-pulse) * gpo->
light_mix_color.
xyz.z, -1);
2014 for ( idx = 0; idx < 4; idx++ ) {
2054 bool override_all =
false;
2063 if ( objnum > -1 ) {
2072 override_all =
true;
2081 if ( !override_all && sip ) {
2096 if ( bank->
is_on ) {
2122 bool override_all =
false;
2131 override_all =
true;
2139 if(!override_all && sip) {
2184 vec3d norm, norm2, fvec, pnt, npnt;
2187 bool do_render =
false;
2229 if (do_render ==
false) {
2243 vec3d submodel_static_offset;
2244 bool submodel_rotation =
false;
2261 submodel_rotation =
true;
2275 if ( submodel_rotation ) {
2276 vm_vec_sub(&loc_offset, &gpt->
pnt, &submodel_static_offset);
2288 vec3d warp_pnt, tmp;
2301 vec3d warp_pnt, tmp;
2320 #define NOISE_SCALE 0.5f
2321 #define MIN_SCALE 3.4f
2322 #define MAX_SCALE 4.7f
2325 vec3d scale_vec = { { { 1.0f, 0.0f, 0.0f } } };
2340 if (magnitude < 0.0
f)
2353 float fog_int = 1.0f;
2397 p.
r = p.
g = p.
b = p.
a = (
ubyte)(255.0
f * fog_int);
2426 float wVal = gpt->
radius * scale * 2;
2449 mag -= (
float)((
int)mag);
2463 size_t num_particles = 0;
2465 if (thruster_info.
use_ab)
2470 for (k = 0; k < num_particles; k++) {
2471 if (thruster_info.
use_ab)
2513 if ( (mn < 0) || (mn >= pm->
n_models) ) {
2589 if ( set_autocen ) {
2693 if ( light_factor < (1.0
f/32.0
f) ) {
2725 object *
objp = NULL;
2740 Warning(
LOCATION,
"Unsupported object type %d for rendering intrinsic-rotate submodels!", objp->
type);
2746 if (model_num == Nmodel_num && Nmodel_instance_num >= 0)
2807 if ( set_autocen ) {
2812 float fog_near = 10.0f, fog_far = 1000.0f;
2815 unsigned char r,
g,
b;
2823 if ( is_outlines_only_htl ) {
2847 if ( !(model_flags & MR_NO_LIGHTING) ) {
2853 if (is_outlines_only_htl || (!
Cmdline_nohtl && !is_outlines_only)) {
2864 && !(is_outlines_only || is_outlines_only_htl) ) {
2875 bool draw_thrusters =
false;
2876 bool trans_buffer =
false;
2883 draw_thrusters =
true;
2895 int detail_model_num = pm->
detail[detail_level];
2897 if ( (is_outlines_only || is_outlines_only_htl) && pm->
submodel[detail_model_num].
outline_buffer != NULL ) {
2910 tmap_flags &= ~TMAP_FLAG_BATCH_TRANSFORMS;
2913 trans_buffer =
true;
2927 int detail_model_num = pm->
detail[detail_level];
2933 if ( draw_thrusters && !(is_outlines_only || is_outlines_only_htl) ) {
2935 trans_buffer =
false;
2945 if ( !( model_flags & MR_NO_TEXTURING ) ) {
2961 if ( !is_outlines_only && !is_outlines_only_htl ) {
2962 if ( ( model_flags & MR_AUTOCENTER ) && set_autocen ) {
2963 vec3d autoback_rotated;
float model_render_determine_light_factor(model_render_params *interp, vec3d *pos, uint flags)
void add_outline(vertex *vert_array, int n_verts, color *clr)
#define TMAP_FLAG_PIXEL_FOG
void model_render_buffers(draw_list *scene, model_render_params *interp, vertex_buffer *buffer, polymodel *pm, int mn, int detail_level, uint tmap_flags)
void submodel_render_immediate(model_render_params *render_info, int model_num, int submodel_num, matrix *orient, vec3d *pos)
int timestamp(int delta_ms)
struct screen3d::@234::@236 xyw
int batch_add_quad(int texture, int tmap_flags, vertex *verts, float alpha)
vec3d render_sphere_offset
weapon Weapons[MAX_WEAPONS]
#define MR_SHOW_OUTLINE_HTL
#define gr_alpha_mask_set
void set_team_color(const team_color &clr)
#define TMAP_FLAG_SOFT_QUAD
int in_sphere(vec3d *pos, float radius, vec3d *view_pos)
float vm_vec_mag_quick(const vec3d *v)
matrix * vm_matrix_x_matrix(matrix *dest, const matrix *src0, const matrix *src1)
void add_insignia(polymodel *pm, int detail_level, int bitmap_num)
void vm_vec_scale_add(vec3d *dest, const vec3d *src1, const vec3d *src2, float k)
#define MISSION_FLAG_FULLNEB
SCP_vector< thruster_particles > normal_thruster_particles
#define gr_pop_scale_matrix
polymodel * model_get(int model_num)
int batch_add_beam(int texture, int tmap_flags, vec3d *start, vec3d *end, float width, float intensity)
void g3_stop_user_clip_plane()
float vm_vec_mag(const vec3d *v)
bool Scene_framebuffer_in_frame
void set_animated_effect(int effect)
asteroid Asteroids[MAX_ASTEROIDS]
void set_thruster_info(mst_info &info)
void vm_rotate_matrix_by_angles(matrix *orient, const angles *tangles)
void set_fog(int fog_mode, int r, int g, int b, float fog_near=-1.0f, float fog_far=-1.0f)
void model_render_glowpoint(int point_num, vec3d *pos, matrix *orient, glow_point_bank *bank, glow_point_bank_override *gpo, polymodel *pm, ship *shipp, bool use_depth_buffer)
ubyte g3_transfer_vertex(vertex *dest, const vec3d *src)
void set_cull_mode(int mode)
void model_render_set_glow_points(polymodel *pm, int objnum)
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
bool model_render_determine_autocenter(vec3d *auto_back, polymodel *pm, int detail_level, uint flags)
int detail[MAX_MODEL_DETAIL_LEVELS]
float detail_depth[MAX_MODEL_DETAIL_LEVELS]
void light_add_point(const vec3d *pos, float r1, float r2, float intensity, float r, float g, float b, int light_ignore_objnum, float spec_r, float spec_g, float spec_b, bool specular)
GLint GLint GLsizei GLsizei GLsizei depth
int get_detail_level_lock()
virtual int getWarpOrientation(matrix *output)
#define MR_SHOW_OUTLINE_PRESET
#define PM_FLAG_TRANS_BUFFER
void set_flags(uint flags)
struct vec3d::@225::@227 xyz
void setLightFilter(int objnum, const vec3d *pos, float rad)
void neb2_get_fog_color(ubyte *r, ubyte *g, ubyte *b)
#define TMAP_HTL_3D_UNLIT
int Num_arc_segment_points
void model_render_immediate(model_render_params *render_info, int model_num, matrix *orient, vec3d *pos, int render, bool sort)
float tertiary_glow_rad_factor
void add_buffer_draw(vertex_buffer *buffer, int texi, uint tmap_flags, model_render_params *interp)
__inline void gr_render_buffer(int start, const vertex_buffer *bufferp, int texi, int flags=TMAP_FLAG_TEXTURED)
void set_buffer(int buffer)
matrix * vm_copy_transpose(matrix *dest, const matrix *src)
#define gr_set_light_factor
vec3d * vm_vec_rotate(vec3d *dest, const vec3d *src, const matrix *m)
#define PM_FLAG_ALLOW_TILING
bool Rendering_to_shadow_map
void set_detail_level_lock(int detail_level_lock)
bool pulse_period_override
void set_insignia_bitmap(int bitmap)
opengl_texture_state Texture
void gr_set_color_fast(color *dst)
#define GR_FILL_MODE_SOLID
int Interp_thrust_scale_subobj
#define MR_DEBUG_BAY_PATHS
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
int batch_add_bitmap_rotated(int texture, int tmap_flags, vertex *pnt, float angle, float rad, float alpha, float depth)
void find_submodel_instance_point_normal(vec3d *outpnt, vec3d *outnorm, int model_instance_num, int submodel_num, const vec3d *submodel_pnt, const vec3d *submodel_norm)
#define MODEL_RENDER_TRANS
void add_matrix(matrix4 &mat)
GLenum GLenum GLenum GLenum GLenum scale
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
GLfloat GLfloat GLfloat v2
#define gr_set_transform_buffer_offset
#define MODEL_RENDER_OPAQUE
float model_render_determine_depth(int obj_num, int model_num, matrix *orient, vec3d *pos, int detail_level_locked)
void set_lighting(bool mode)
void model_draw_paths_htl(int model_num, uint flags)
void model_render_insignias(polymodel *pm, int detail_level, int bitmap_num)
int NORMMAP
Normal mapping.
float gun_submodel_rotation
float get_animated_effect_timer()
void particle_emit(particle_emitter *pe, int type, int optional_data, float range)
thruster_bank * thrusters
#define TMAP_ANIMATED_SHADER
#define MR_ATTACHED_MODEL
std::deque< bool > glow_point_bank_active
#define IS_VEC_NULL_SQ_SAFE(v)
#define CLAMP(x, min, max)
int HEIGHTMAP
Height map for normal mapping.
void g3_start_user_clip_plane(const vec3d *plane_point, const vec3d *plane_normal)
void g3_done_instance(bool set_api=false)
void gr_set_color(int r, int g, int b)
int texture_maps[TM_NUM_TYPES]
const vec3d & get_warp_scale()
SCP_vector< buffer_data > tex_buf
light_indexing_info bufferLights()
void model_find_submodel_offset(vec3d *outpnt, int model_num, int sub_model_num)
void set_alpha(float alpha)
#define PM_FLAG_HAS_INTRINSIC_ROTATE
void model_render_queue(model_render_params *interp, draw_list *scene, int model_num, matrix *orient, vec3d *pos)
void set_center_alpha(int center_alpha)
void model_draw_paths(int model_num, uint flags)
void set_debug_flags(uint flags)
void vm_vec_add2(vec3d *dest, const vec3d *src)
#define GR_ALPHABLEND_FILTER
WarpEffect * warpout_effect
GLdouble GLdouble GLdouble r
void model_draw_bay_paths(int model_num)
struct matrix::@228::@230 vec
float neb2_get_fog_intensity(object *obj)
virtual int getWarpPosition(vec3d *output)
void set_animated_timer(float time)
void vm_vec_scale(vec3d *dest, float s)
#define TMAP_FLAG_GOURAUD
int gameseq_get_state_idx(char *s)
void model_queue_render_thrusters(model_render_params *interp, polymodel *pm, int objnum, ship *shipp, matrix *orient, vec3d *pos)
void interp_render_arc_segment(vec3d *v1, vec3d *v2, int depth)
GLboolean GLboolean GLboolean GLboolean a
#define gr_set_thrust_scale
ai_profile_t * ai_profile
void set_light_filter(int objnum, vec3d *pos, float rad)
int clip_plane(int plane_flag, vertex **src, vertex **dest, int *nv, ccodes *cc, uint flags)
Clips a plane to the viewing pyramid.
int GLOWMAP
References a map that is a fully lit version of its index -Bobboau.
void moldel_calc_facing_pts(vec3d *top, vec3d *bot, vec3d *fvec, vec3d *pos, float w, float z_add, vec3d *Eyeposition)
texture_map maps[MAX_MODEL_TEXTURES]
bool use_render_box_offset
const int MAX_ARC_SEGMENT_POINTS
void model_draw_bay_paths_htl(int model_num)
void set_team_color(team_color &clr)
void submodel_render_queue(model_render_params *render_info, draw_list *scene, int model_num, int submodel_num, matrix *orient, vec3d *pos)
void vm_rot_point_around_line(vec3d *out, const vec3d *in, float angle, const vec3d *line_point, const vec3d *line_dir)
submodel_instance * submodel
vertex_buffer detail_buffers[MAX_MODEL_DETAIL_LEVELS]
vertex_buffer trans_buffer
float distortion_length_factor
ubyte g3_rotate_vertex(vertex *dest, const vec3d *src)
int model_render_determine_detail(float depth, int obj_num, int model_num, matrix *orient, vec3d *pos, int flags, int detail_level_locked)
#define TMAP_FLAG_DESATURATE
#define TMAP_FLAG_BATCH_TRANSFORMS
light_indexing_info lights
bool use_render_sphere_offset
void init_render(bool sort=true)
fix model_render_determine_base_frametime(int objnum, uint flags)
void set_texture_addressing(int addressing)
bool setLights(const light_indexing_info *info)
int get_insignia_bitmap()
void set_color(color &clr)
int g3_project_vertex(vertex *point)
void model_draw_debug_points(polymodel *pm, bsp_info *submodel, uint flags)
vec3d * vm_vec_unrotate(vec3d *dest, const vec3d *src, const matrix *m)
SCP_vector< thruster_particles > afterburner_thruster_particles
float neb2_get_lod_scale(int objnum)
#define REPLACE_WITH_INVISIBLE
void set_forced_bitmap(int bitmap)
GLint GLint GLint GLint GLint x
object Objects[MAX_OBJECTS]
bool Glowpoint_use_depth_buffer
#define MR_SHOW_THRUSTERS
void set_replacement_textures(int *textures)
#define gr_push_scale_matrix
void add_submodel_to_batch(int model_num)
vec3d Arc_segment_points[]
#define gr_set_texture_addressing
void add_arc(vec3d *v1, vec3d *v2, color *primary, color *secondary, float arc_width)
SCP_unordered_map< int, void * > glowpoint_bank_override_map
void vm_vec_copy_scale(vec3d *dest, const vec3d *src, float s)
const vec3d & get_clip_plane_pos()
#define TMAP_ADDRESS_WRAP
#define TMAP_FLAG_CORRECT
float model_render_determine_box_scale()
void set_scale(vec3d *scale=NULL)
float detail_distance_mult[MAX_DETAIL_LEVEL+1]
void set_depth_scale(float scale)
void model_render_debug_children(polymodel *pm, int mn, int detail_level, uint debug_flags)
void vm_vec_sub(vec3d *dest, const vec3d *src0, const vec3d *src1)
void set_model_transform(matrix4 &transform, int model_id)
ubyte arc_type[MAX_ARC_EFFECTS]
GLboolean GLboolean GLboolean b
__inline void gr_fog_set(int fog_mode, int r, int g, int b, float fog_near=-1.0f, float fog_far=-1.0f)
int shockwave_get_framenum(int index, int num_frames)
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
polymodel_instance * model_get_instance(int model_instance_num)
fix base_texture_anim_frametime
void model_render_children_buffers(draw_list *scene, model_render_params *interp, polymodel *pm, polymodel_instance *pmi, int mn, int detail_level, uint tmap_flags, bool trans_buffer)
glow_point_bank * glow_point_banks
int transform_buffer_offset
float vm_vec_dist_quick(const vec3d *v0, const vec3d *v1)
GLubyte GLubyte GLubyte GLubyte w
void model_render_glow_points(polymodel *pm, ship *shipp, matrix *orient, vec3d *pos, bool use_depth_buffer=true)
GLuint GLenum GLenum transform
void set_color(const color &clr)
int batch_add_bitmap(int texture, int tmap_flags, vertex *pnt, int orient, float rad, float alpha, float depth)
void set_blend_filter(int filter, float alpha)
int model_should_render_engine_glow(int objnum, int bank_obj)
void light_add_cone(const vec3d *pos, const vec3d *dir, float angle, float inner_angle, bool dual_cone, float r1, float r2, float intensity, float r, float g, float b, int light_ignore_objnum, float spec_r, float spec_g, float spec_b, bool specular)
model_batch_buffer TransformBufferHandler
int get_animated_effect_num()
void set_warp_params(int bitmap, float alpha, vec3d &scale)
void submit_buffer_data()
float vm_vec_copy_normalize(vec3d *dest, const vec3d *src)
void model_render_shields(polymodel *pm, uint flags)
void render_all(int depth_mode=-1)
float render_sphere_radius
void set_light_factor(float factor)
void neb2_get_adjusted_fog_values(float *fnear, float *ffar, object *objp)
texture_info textures[TM_NUM_TYPES]
SCP_vector< ship_info > Ship_info
void g3_start_instance_matrix(const vec3d *pos, const matrix *orient, bool set_api=true)
#define TMAP_FLAG_TEXTURED
uint gr_determine_model_shader_flags(bool lighting, bool fog, bool textured, bool in_shadow_map, bool thruster_scale, bool transform, bool team_color_set, int tmap_flags, int spec_map, int glow_map, int normal_map, int height_map, int env_map, int misc_map)
int static_rand(int num)
Return a pseudo random 32 bit value given a reasonably small number.
int model_interp_get_texture(texture_info *tinfo, fix base_frametime)
const int * get_replacement_textures()
#define MAX_MODEL_DETAIL_LEVELS
int secondary_glow_bitmap
void model_render_add_lightning(draw_list *scene, model_render_params *interp, polymodel *pm, bsp_info *sm)
GLsizei GLsizei GLuint * obj
const color & get_color()
#define DETAIL_FLAG_MODELS
int ENVMAP
References a map that is for environment mapping -Bobboau.
#define gr_reset_lighting
float vm_vec_dot(const vec3d *v0, const vec3d *v1)
vec3d arc_pts[MAX_ARC_EFFECTS][2]
#define gr_set_animated_effect
void set_clip_plane(vec3d &pos, vec3d &normal)
void set_depth_mode(int depth_set)
#define GR_BITBLT_MODE_NORMAL
#define gr_update_transform_buffer
float secondary_glow_rad_factor
int SPECMAP
References a map that is for specular mapping -Bobboau.
void set_animated_effect(int effect_num, float timer)
int in_box(vec3d *min, vec3d *max, vec3d *pos, vec3d *view_pos)
void model_render_debug(int model_num, matrix *orient, vec3d *pos, uint flags, uint debug_flags, int objnum, int detail_level_locked)
void interp_render_arc(vec3d *v1, vec3d *v2, color *primary, color *secondary, float arc_width)
void set_clip_plane(const vec3d &position, const vec3d &normal)
bool is_minimum_GLSL_version()
const team_color & get_team_color()
WarpEffect * warpin_effect
int g3_draw_sphere_ez(const vec3d *pnt, float rad)
bool model_render_check_detail_box(vec3d *view_pos, polymodel *pm, int submodel_num, uint flags)
#define TMAP_FLAG_DISTORTION_THRUSTER
#define GR_ALPHABLEND_NONE
#define TMAP_ADDRESS_CLAMP
int distortion_add_beam(int texture, int tmap_flags, vec3d *start, vec3d *end, float width, float intensity, float offset)
int MISCMAP
Utility map, to be utilized for various things shader authors can come up with.
#define gr_set_team_color
vec3d get_view_position()
GLclampf GLclampf GLclampf alpha
void set_object_number(int num)
float distortion_rad_factor
void start_model_batch(int n_models)
bool glow_bitmap_override
void vm_vec_add(vec3d *dest, const vec3d *src0, const vec3d *src1)
void gr_init_color(color *c, int r, int g, int b)
matrix vmd_identity_matrix
void set_texture(int texture_type, int texture_handle)
const vec3d & get_clip_plane_normal()
void push_transform(vec3d *pos, matrix *orient)
float model_find_closest_point(vec3d *outpnt, int model_num, int submodel_num, matrix *orient, vec3d *pos, vec3d *eye_pos)
bool model_get_team_color(team_color *clr, const SCP_string &team, const SCP_string &secondaryteam, fix timestamp, int fadetime)
const mst_info & get_thruster_info()
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
#define GR_FILL_MODE_WIRE
void addLight(const light *light_ptr)
void set_fill_mode(int mode)
float vm_vec_normalize(vec3d *v)
void set_num_models(int n_models)
float Interp_thrust_scale
generic_anim thruster_bitmap
void set_thrust_scale(float scale=-1.0f)