rename brdf_lut
parent
4e346fdd9d
commit
444285ca59
|
@ -2,26 +2,7 @@
|
||||||
#include "light.glsl"
|
#include "light.glsl"
|
||||||
#include "brdf.glsl"
|
#include "brdf.glsl"
|
||||||
#include "sh_lighting.glsl"
|
#include "sh_lighting.glsl"
|
||||||
|
#include "lightmap.glsl"
|
||||||
#ifdef LIGHTMAP_BAKING
|
|
||||||
void main() {
|
|
||||||
vec3 n = normalize(v_normal_ws);
|
|
||||||
vec4 diffuse;
|
|
||||||
|
|
||||||
if(u_textured) {
|
|
||||||
diffuse = texture(u_texture2d, v_texcoord);
|
|
||||||
} else {
|
|
||||||
diffuse = u_diffuse; // * v_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (u_texlit) {
|
|
||||||
vec4 litsample = texture(u_lightmap, v_texcoord);
|
|
||||||
diffuse *= litsample;
|
|
||||||
}
|
|
||||||
|
|
||||||
fragcolor = vec4(diffuse.rgb*u_litboost, 1.0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SHADING_PHONG
|
#ifdef SHADING_PHONG
|
||||||
void main() {
|
void main() {
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#ifdef LIGHTMAP_BAKING
|
||||||
|
void main() {
|
||||||
|
vec3 n = normalize(v_normal_ws);
|
||||||
|
vec4 diffuse;
|
||||||
|
|
||||||
|
if(u_textured) {
|
||||||
|
diffuse = texture(u_texture2d, v_texcoord);
|
||||||
|
} else {
|
||||||
|
diffuse = u_diffuse; // * v_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (u_texlit) {
|
||||||
|
vec4 litsample = texture(u_lightmap, v_texcoord);
|
||||||
|
diffuse *= litsample;
|
||||||
|
}
|
||||||
|
|
||||||
|
fragcolor = vec4(diffuse.rgb*u_litboost, 1.0);
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -384555,7 +384555,7 @@ static void brdf_load() {
|
||||||
static int program = -1, vao = -1;
|
static int program = -1, vao = -1;
|
||||||
if( program < 0 ) {
|
if( program < 0 ) {
|
||||||
const char* vs = vfs_read("shaders/vs_0_2_fullscreen_quad_B_flipped.glsl");
|
const char* vs = vfs_read("shaders/vs_0_2_fullscreen_quad_B_flipped.glsl");
|
||||||
const char* fs = vfs_read("shaders/brdf.glsl");
|
const char* fs = vfs_read("shaders/brdf_lut.glsl");
|
||||||
|
|
||||||
program = shader(vs, fs, "", "fragcolor", NULL);
|
program = shader(vs, fs, "", "fragcolor", NULL);
|
||||||
glGenVertexArrays( 1, (GLuint*)&vao );
|
glGenVertexArrays( 1, (GLuint*)&vao );
|
||||||
|
|
|
@ -2899,7 +2899,7 @@ static void brdf_load() {
|
||||||
static int program = -1, vao = -1;
|
static int program = -1, vao = -1;
|
||||||
if( program < 0 ) {
|
if( program < 0 ) {
|
||||||
const char* vs = vfs_read("shaders/vs_0_2_fullscreen_quad_B_flipped.glsl");
|
const char* vs = vfs_read("shaders/vs_0_2_fullscreen_quad_B_flipped.glsl");
|
||||||
const char* fs = vfs_read("shaders/brdf.glsl");
|
const char* fs = vfs_read("shaders/brdf_lut.glsl");
|
||||||
|
|
||||||
program = shader(vs, fs, "", "fragcolor", NULL);
|
program = shader(vs, fs, "", "fragcolor", NULL);
|
||||||
glGenVertexArrays( 1, (GLuint*)&vao );
|
glGenVertexArrays( 1, (GLuint*)&vao );
|
||||||
|
|
|
@ -19698,7 +19698,7 @@ static void brdf_load() {
|
||||||
static int program = -1, vao = -1;
|
static int program = -1, vao = -1;
|
||||||
if( program < 0 ) {
|
if( program < 0 ) {
|
||||||
const char* vs = vfs_read("shaders/vs_0_2_fullscreen_quad_B_flipped.glsl");
|
const char* vs = vfs_read("shaders/vs_0_2_fullscreen_quad_B_flipped.glsl");
|
||||||
const char* fs = vfs_read("shaders/brdf.glsl");
|
const char* fs = vfs_read("shaders/brdf_lut.glsl");
|
||||||
|
|
||||||
program = shader(vs, fs, "", "fragcolor", NULL);
|
program = shader(vs, fs, "", "fragcolor", NULL);
|
||||||
glGenVertexArrays( 1, (GLuint*)&vao );
|
glGenVertexArrays( 1, (GLuint*)&vao );
|
||||||
|
|
Loading…
Reference in New Issue