Skip to content

Commit

Permalink
clean textures
Browse files Browse the repository at this point in the history
  • Loading branch information
but0n committed Mar 7, 2020
1 parent 5e46ede commit 568bb22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 4 additions & 6 deletions bvh.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,14 @@

// let hdrEnv2 = await Asset.loadTexture('res/envmap/lebombo_4k.hdr');
// let hdrEnv = await Asset.loadTexture('res/envmap/helipad/negz.hdr');
let wall = await Asset.loadTexture('res/textures/988021.jpg');
let ground = await Asset.loadTexture('res/textures/grid.jpg');
let uvck = await Asset.loadTexture('res/textures/checker.png');
// albedo.flipY = true;


let skybox = await Asset.loadCubemap('res/envmap/helipad/', 'hdr');
let skybox2 = await Asset.loadTexture('res/envmap/sky.jpg');
skybox2.flipY = true;
// let skybox2 = await Asset.loadTexture('res/envmap/sky.jpg');
// skybox2.flipY = true;
let diffenv = await Asset.loadCubemap('res/envmap/helipad_diff/', 'hdr');
// let skybox = await Asset.loadCubemap(assetRoot + 'res/envmap/GoldenGateBridge2/');

Expand Down Expand Up @@ -270,10 +269,9 @@
let rt = new rayTracing(screen, cam, rtShader);
Material.setTexture(rt.material, 'triangleTex', triangleTexture.tex);
Material.setTexture(rt.material, 'LBVHTex', LBVH.tex);
Material.setTexture(rt.material, 'skybox', skybox2);
// Material.setTexture(rt.material, 'hdrSky', skybox);
// Material.setTexture(rt.material, 'skybox', skybox2);
Material.setTexture(rt.material, 'hdrSky', skybox);
// Material.setTexture(rt.material, 'hdr', hdrEnv);
Material.setTexture(rt.material, 'wall', wall);
Material.setTexture(rt.material, 'ground', ground);
Material.setTexture(rt.material, 'uvck', uvck);

Expand Down
5 changes: 2 additions & 3 deletions res/shader/ray.fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ uniform sampler2D LBVHTex;
uniform samplerCube hdrSky;
uniform sampler2D skybox;
uniform sampler2D hdr;
uniform sampler2D wall;
uniform sampler2D ground;
uniform sampler2D uvck;
#include <mat_params>
Expand Down Expand Up @@ -640,9 +639,9 @@ vec3 render(in vec3 ro, in vec3 rd, inout float seed) {
// rd = cosWeightedRandomHemisphereDirection(normal, seed);
} else {
// col *= pow( texture(skybox, rd).rgb, vec3(GAMMA) ) * 1.;
col *= sRGBtoLINEAR(texture(skybox, getuv(rd) + vec2(0,0))).rgb * 1.4;
// col *= sRGBtoLINEAR(texture(skybox, getuv(rd) + vec2(0,0))).rgb * 1.4;
// col *= sRGBtoLINEAR(texture(skybox, getuv(rd) + vec2(0.6,0))).rgb * 1.2;
// col *= texture(hdrSky, rd).rgb * 1.;
col *= texture(hdrSky, rd).rgb * 1.4;
// col *= texture(hdr, getuv(rd)).rgb * 1.;
return col;
}
Expand Down

0 comments on commit 568bb22

Please sign in to comment.