add u_global_alpha

main
Dominik Madarász 2024-08-25 17:13:34 +02:00
parent d1420e070b
commit 8f09aec00b
12 changed files with 49 additions and 1 deletions

View File

@ -1441,6 +1441,7 @@ enum BILLBOARD_MODE {
void model_set_frustum(model_t *m, frustum f);
void model_clear_frustum(model_t *m);
bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out);
bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out);
void model_destroy(model_t);
unsigned model_getpass();
unsigned model_setpass(unsigned pass);

View File

@ -43,6 +43,7 @@ vec4 shadowing() {
return shadowmap(vpeye, vneye, v_texcoord, sc);
}
uniform float u_global_alpha; /// set:1.0
uniform vec3 u_cam_pos;
uniform vec3 u_cam_dir;
uniform float frame_time;

View File

@ -199,6 +199,7 @@ surface_t surface() {
s.fragcolor.rgb += s.emissive;
s.fragcolor *= shadowing();
s.fragcolor.rgb += get_rimlight();
s.fragcolor.a *= u_global_alpha;
#ifdef SHADING_PBR
{

View File

@ -17708,6 +17708,7 @@ API bool model_has_transparency(model_t m);
API void model_set_frustum(model_t *m, frustum f);
API void model_clear_frustum(model_t *m);
API bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out);
API bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out);
API void model_destroy(model_t);
API unsigned model_getpass();
@ -385793,6 +385794,20 @@ bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out) {
return true;
}
bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out) {
if(!m.iqm) return false;
iqm_t *q = m.iqm;
mat34 f;
if (!model_get_bone_pose(m, joint, &f)) return false;
vec3 pos = vec3(f[3],f[7],f[11]);
pos = transform344(M, pos);
*out = pos;
return true;
}
anim_t clip(float minframe, float maxframe, float blendtime, unsigned flags) {
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
}

View File

@ -4127,6 +4127,20 @@ bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out) {
return true;
}
bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out) {
if(!m.iqm) return false;
iqm_t *q = m.iqm;
mat34 f;
if (!model_get_bone_pose(m, joint, &f)) return false;
vec3 pos = vec3(f[3],f[7],f[11]);
pos = transform344(M, pos);
*out = pos;
return true;
}
anim_t clip(float minframe, float maxframe, float blendtime, unsigned flags) {
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
}

View File

@ -740,6 +740,7 @@ API bool model_has_transparency(model_t m);
API void model_set_frustum(model_t *m, frustum f);
API void model_clear_frustum(model_t *m);
API bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out);
API bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out);
API void model_destroy(model_t);
API unsigned model_getpass();

View File

@ -20926,6 +20926,20 @@ bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out) {
return true;
}
bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out) {
if(!m.iqm) return false;
iqm_t *q = m.iqm;
mat34 f;
if (!model_get_bone_pose(m, joint, &f)) return false;
vec3 pos = vec3(f[3],f[7],f[11]);
pos = transform344(M, pos);
*out = pos;
return true;
}
anim_t clip(float minframe, float maxframe, float blendtime, unsigned flags) {
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
}

View File

@ -3775,6 +3775,7 @@ API bool model_has_transparency(model_t m);
API void model_set_frustum(model_t *m, frustum f);
API void model_clear_frustum(model_t *m);
API bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out);
API bool model_get_bone_position(model_t m, unsigned joint, mat44 M, vec3 *out);
API void model_destroy(model_t);
API unsigned model_getpass();

View File

@ -25,7 +25,7 @@
int verbose = 0;
int need_to_bake_skin = 0;
int save_all_bones = 0;
int save_all_bones = 1;
int dolowprec = 0;
int dostatic = 0; // export without skeleton

Binary file not shown.

Binary file not shown.

Binary file not shown.