V!nc3r Posted February 8, 2018 Share Posted February 8, 2018 (edited) Hi guys! Since I use BJS, I always be kind of stucked with lightmap blending with my materials. I was working on standard workflow, but now I'm testing PBR, I have still the same issue, so this thread to understand deeper the blocking factor. I never succeeded to get (basically) the same render from my 3D lighting scene to BJS, after many many tests So I consistently had to tweak my hundred of lightmaps files in Photoshop to increase contrast/luminosity. These lightmaps could came from the usuals RenderToTextures passes from 3D softwares: 3DSMax & VRay, from a RawTotalLighting pass Blender & Cycles, from a Diffuse Direct & Indirect pass Having to manually tweak these lightmaps cause me to lighting my scenes in a blind way (which is of course very annoying), and to not have a WYSIWYG workflow (like: tweak a lightmap > save > reload BJS scene > retweak > etc). So here a test scene to discuss about: http://www.babylonjs-playground.com/#59ZXVF#11 (sources) (here the lightmap of the room). You can easily switch or add lightmap mode using the line 32, default here is lightmap file set in lightmapTexture as shadowMap. Because I'm a devianted person, I wanted to compare with another engine, so I made a scene on https://playcanv.as/b/OuZIGpY0/ : here you can see that my white data on my lightmaps files are read in a better way, they burn materials a little ; I think dark data are darker too. (note that PlayCanvas allow to send HDR files and convert them to RGBM, giving an interesting result, but in the link above I used the exactly same png file than in BJS, of course). And the result is totally satisfying. So, have I missed a magic parameter? Is the shader need a little tweaking? Is my workflow totally wrong? How do you personally deal with lightmaps? Edited February 12, 2018 by V!nc3r solved Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2018 Share Posted February 8, 2018 Hello, first of all in order to compare we will need to have everyone in PBR or in std. Seems like the Playcanvas one is not using PBR. The lightmap in bjs is less important as the main source of energy comes from the environment Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2018 Share Posted February 8, 2018 WAIT!! I found a bug We were not reading the lightmap in linear mode! Stay tuned! V!nc3r 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 8, 2018 Share Posted February 8, 2018 http://www.babylonjs-playground.com/#59ZXVF#12 (please also note line #25 where I can manually force the impact of the lightmap) Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted February 8, 2018 Author Share Posted February 8, 2018 I think the playcanvas scene is on PBR but it's true that default environment is not the same (and I don't find where is it in playcanvas, scene ambientColor doesn't change anything, and there is not default skybox), but! when I play with the gamma button, render tend to be similar than BJS! (below 1.0 instead of the default 2.2) Is this related to the lightmap linear mode you talking about, or another path to investigate? About the level parameter, I believe it tends to burn too fast lightmaps values (like the light impact on the ground). I'm waiting about the linear thing Quote Link to comment Share on other sites More sharing options...
Guest Posted February 9, 2018 Share Posted February 9, 2018 They are not using PBR (I sniffed their shader ;)) My linear thingy is published my dear..please let me know sharp and V!nc3r 2 Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted February 12, 2018 Author Share Posted February 12, 2018 Yeah, you rocks! It seems to work much better: http://www.babylonjs-playground.com/#59ZXVF#15 I've added a neutral environment, by not using the default one of createDefaultEnvironment, it adds a more... neutral... light (line 6). It looks like we now have a better interpretation than playcanvas (playcanvas ref vs BJS patched). Thanks for that great patch! sharp, Exa, BitOfGold and 1 other 3 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2018 Share Posted February 12, 2018 Man! thank you for finding it:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.