add u_global_alpha
parent
d1420e070b
commit
8f09aec00b
|
@ -1441,6 +1441,7 @@ enum BILLBOARD_MODE {
|
||||||
void model_set_frustum(model_t *m, frustum f);
|
void model_set_frustum(model_t *m, frustum f);
|
||||||
void model_clear_frustum(model_t *m);
|
void model_clear_frustum(model_t *m);
|
||||||
bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out);
|
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);
|
void model_destroy(model_t);
|
||||||
unsigned model_getpass();
|
unsigned model_getpass();
|
||||||
unsigned model_setpass(unsigned pass);
|
unsigned model_setpass(unsigned pass);
|
||||||
|
|
|
@ -43,6 +43,7 @@ vec4 shadowing() {
|
||||||
return shadowmap(vpeye, vneye, v_texcoord, sc);
|
return shadowmap(vpeye, vneye, v_texcoord, sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uniform float u_global_alpha; /// set:1.0
|
||||||
uniform vec3 u_cam_pos;
|
uniform vec3 u_cam_pos;
|
||||||
uniform vec3 u_cam_dir;
|
uniform vec3 u_cam_dir;
|
||||||
uniform float frame_time;
|
uniform float frame_time;
|
||||||
|
|
|
@ -199,6 +199,7 @@ surface_t surface() {
|
||||||
s.fragcolor.rgb += s.emissive;
|
s.fragcolor.rgb += s.emissive;
|
||||||
s.fragcolor *= shadowing();
|
s.fragcolor *= shadowing();
|
||||||
s.fragcolor.rgb += get_rimlight();
|
s.fragcolor.rgb += get_rimlight();
|
||||||
|
s.fragcolor.a *= u_global_alpha;
|
||||||
|
|
||||||
#ifdef SHADING_PBR
|
#ifdef SHADING_PBR
|
||||||
{
|
{
|
||||||
|
|
|
@ -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_set_frustum(model_t *m, frustum f);
|
||||||
API void model_clear_frustum(model_t *m);
|
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_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 void model_destroy(model_t);
|
||||||
|
|
||||||
API unsigned model_getpass();
|
API unsigned model_getpass();
|
||||||
|
@ -385793,6 +385794,20 @@ bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out) {
|
||||||
return true;
|
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) {
|
anim_t clip(float minframe, float maxframe, float blendtime, unsigned flags) {
|
||||||
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
|
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4127,6 +4127,20 @@ bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out) {
|
||||||
return true;
|
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) {
|
anim_t clip(float minframe, float maxframe, float blendtime, unsigned flags) {
|
||||||
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
|
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_set_frustum(model_t *m, frustum f);
|
||||||
API void model_clear_frustum(model_t *m);
|
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_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 void model_destroy(model_t);
|
||||||
|
|
||||||
API unsigned model_getpass();
|
API unsigned model_getpass();
|
||||||
|
|
14
engine/v4k.c
14
engine/v4k.c
|
@ -20926,6 +20926,20 @@ bool model_get_bone_pose(model_t m, unsigned joint, mat34 *out) {
|
||||||
return true;
|
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) {
|
anim_t clip(float minframe, float maxframe, float blendtime, unsigned flags) {
|
||||||
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
|
return ((anim_t){minframe, maxframe, blendtime, flags, 1e6});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_set_frustum(model_t *m, frustum f);
|
||||||
API void model_clear_frustum(model_t *m);
|
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_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 void model_destroy(model_t);
|
||||||
|
|
||||||
API unsigned model_getpass();
|
API unsigned model_getpass();
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
int need_to_bake_skin = 0;
|
int need_to_bake_skin = 0;
|
||||||
int save_all_bones = 0;
|
int save_all_bones = 1;
|
||||||
int dolowprec = 0;
|
int dolowprec = 0;
|
||||||
|
|
||||||
int dostatic = 0; // export without skeleton
|
int dostatic = 0; // export without skeleton
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue