do_lightmap()
parent
5d0ed47b3a
commit
79dca69ac3
|
@ -1420,6 +1420,7 @@ enum BILLBOARD_MODE {
|
||||||
aabb model_aabb(model_t, mat44 transform);
|
aabb model_aabb(model_t, mat44 transform);
|
||||||
void model_lod(model_t*, float lo_detail, float hi_detail, float morph);
|
void model_lod(model_t*, float lo_detail, float hi_detail, float morph);
|
||||||
void model_shading(model_t*, int shading);
|
void model_shading(model_t*, int shading);
|
||||||
|
void model_shading_custom(model_t*, int shading, const char *vs, const char *fs, const char *defines);
|
||||||
void model_skybox(model_t*, skybox_t sky, bool load_sh);
|
void model_skybox(model_t*, skybox_t sky, bool load_sh);
|
||||||
void model_render(model_t, mat44 proj, mat44 view, mat44 model, int shader);
|
void model_render(model_t, mat44 proj, mat44 view, mat44 model, int shader);
|
||||||
void model_render_skeleton(model_t, mat44 model);
|
void model_render_skeleton(model_t, mat44 model);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
bool do_lightmap() {
|
||||||
#ifdef LIGHTMAP_BAKING
|
#ifdef LIGHTMAP_BAKING
|
||||||
void main() {
|
|
||||||
vec3 n = normalize(v_normal_ws);
|
vec3 n = normalize(v_normal_ws);
|
||||||
vec4 diffuse;
|
vec4 diffuse;
|
||||||
|
|
||||||
|
@ -15,5 +15,8 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fragcolor = vec4(diffuse.rgb*u_litboost, 1.0);
|
fragcolor = vec4(diffuse.rgb*u_litboost, 1.0);
|
||||||
}
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
|
@ -2,9 +2,9 @@
|
||||||
#include "lightmap.glsl"
|
#include "lightmap.glsl"
|
||||||
#include "surface.glsl"
|
#include "surface.glsl"
|
||||||
|
|
||||||
#ifndef LIGHTMAP_BAKING
|
|
||||||
void main() {
|
void main() {
|
||||||
|
if (do_lightmap())
|
||||||
|
return;
|
||||||
surface_t surf = surface();
|
surface_t surf = surface();
|
||||||
fragcolor = surf.fragcolor;
|
fragcolor = surf.fragcolor;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in New Issue