Dad72 Posted May 23, 2018 Share Posted May 23, 2018 Hello @Luaacro, First of all, thank you for this new material. ? To follow the discussion on the PR, I still have the problem with mixTexture1 and mixTexture2 that mix. I still have also the problem with alpha channels that do not draw textures but a light shade or very dark. The idea was to have a mix with the diffuseTextures, but not with the mixTextures because the effect obtained does not give the desired result. For you to understand better, I add my terrain editor online for you to test and see the result live : Demo Terrain Editor (I can send you the full zip if you need.) I intend to offer this complet terrain editor for Babylon, I think it can be useful to many people. Use : select the terrain 'Delos' in the menu Load : Activate edition mode (red button) Select Painting mode to paint textures in the terrain. select the texture one by one and paint. We can see that the textures is a mix between diffuseTexture1 with diffuseTexture5, diffuseTexture2 with diffuseTexture6, diffuseTexture3 with diffuseTexture7, diffuseTexture4 with diffuseTexture8 (mixTexture1 and mixTexture2 are mixing according to their RGBA channel) We can also see that it is not possible to paint sand, it is simply transparent shadows or very dark. (I try material.alpha 1.0, but that does not change anything.) try to paint snow on the mountain and repaint some rock over the snow. the snow remains apparent. The shadows, Fog and lights work perfectly well. ? Thank you for your help. Screenshot result : Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted May 30, 2018 Share Posted May 30, 2018 Hey @Dad72! Just fixed the material here: https://github.com/BabylonJS/Babylon.js/pull/4406 now the mix is better. I did a little mistake :) Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted May 30, 2018 Share Posted May 30, 2018 I'm unable to load "Delos" :( BJS - [20:08:26]: Unable to import meshes from data/Delos_ground.babylon?1527703706785: Error in onSuccess callback Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 30, 2018 Author Share Posted May 30, 2018 Oh it's strange, it worked before. I will look and correct so that you can test it. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 30, 2018 Author Share Posted May 30, 2018 @Luaacro Ok, it works now. Demo Terrain Editor Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 30, 2018 Author Share Posted May 30, 2018 The mix is better, yes. 1) The problem for alpha channel 4 and 8 still does not work properly. (no textures). I try to make a white or black color, the alpha erases either the mixMap1 or the mixMap2. 2) There is also serialization problem with a terrain using MixMaterial and also TerrainMaterial. See this topic with PGs Merci Luaacro Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 31, 2018 Author Share Posted May 31, 2018 I tried to modify the mixMaterial shader by setting the alpha to 1.0. the result is that it will create a single texture across my mix map and erase other RGBs and take into account only the mixMap2. I think that the alpha channel does not allow to paint a texture by keeping the other 6 textures. So, I was wondering if we should not create a third mixMap of ways to make 3 * 3 diffuse textures for 9 textures with RGB mix and let the alpha has 0 on the 3 mix map. What do you think @Luaacro ? you think a third mixMap is possible to make 9 texture with RGB mix? Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted May 31, 2018 Share Posted May 31, 2018 I'm taking a look on serialization, that should not happen If I understand well, in your tool, that texture 8 (not 4 because it crashes the editor) is adding alpha so the alpha value is equal to 0 to draw the 8th texture ? Or 255 ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 31, 2018 Author Share Posted May 31, 2018 Yes that must be it. I do not really know. Channel 4 (grass) and 8 (sand) make a transparent texture. (or rather erases RGB textures) It does not happen. and if I invert the color (white instead of black) it draws a black color and no textures. There on my editor channel 4 is white and channel 8 is black. I can not understand how to use this alpha channel. I did a color inversion alpha on the editor so you better see what I mean. PS: I just corrected channel 4 (it miss the white color texture to paint) julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 31, 2018 Author Share Posted May 31, 2018 I just had an improvement with other tests. Rather than painting black or white, I put transparency on mixMap, and it works. The mellange of 8 textures works so. The problem I have now is to paint with a transparent texture. I do not know how to paint transparency ? ideas ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 1, 2018 Author Share Posted June 1, 2018 @Luaacro : Ok, I managed to paint transparency. For this to work, mixMap2 must be all black at first, to make mixMap1 appear first. The 4 and 8 texture works now. On the other hand, there remains a detail at the level of the layers of paint. If I paint on the mixMap1, everything is ok, then on the mixMp2, it works well too, but if I do the opposite, I paint the mixMap2, then mixMap1, it does not work. MixMap2 is always above mixMap1. --------- I updated the field editor with all the fixes. We can see that it works a little better. For example, try painting snow and then painting rock over the snow. It will not work. On the other hand the opposite works if one paints rock, then snow on top. Editor of terrain Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 1, 2018 Share Posted June 1, 2018 Excellent! Just tested and it works really well For your problem: in the shader, the mixmap 1 mixes the 4 first textures. The mixmap 2 mixes the 4 last textures with the first mix from mixmap 1. When you paint using the mixmap 2, don't forget to clear the mixmap 1 by reseting the values to (0, 0, 0, 255) where you are painting. Do you see what I mean? Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 1, 2018 Author Share Posted June 1, 2018 Yes, I had noticed for the erasure. I thought about adding this to the editor. Do you find the problem for serialization? Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 1, 2018 Share Posted June 1, 2018 You should because I cannot handle that feature in the GLSL code Yes and I answered Maybe that can help you 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.