Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Playing with shaders, I've noticed when using additional blendmode 12, (look-trough-ish brightening), all grass and leaves behind the shader-textured mesh are disappearing. Not useful except for some kind of agent-orange goggles. Does anyone know a solution to this problem? |
||||
|
Hello Dieter, Perhaps that you could try the Irrlicht shader 26 (Transparent Alpha Channel). Settings in this screen capture uploaded on my OneDrive (secured and anonymous access) : https://1drv.ms/u/s!AjokN1FU3jK1... |
||||
|
Thanks, no, unfort. that didn't fix it. Have a look at the shader I posted in showcase, you attach it to a cube as a behavior. It's a funny shader, but it also shows this problem. |
||||
|
Dieter, I indeed visited your thread relative to a webgl shader posted in showcase. I tested it and I may say that it is an interesting one. The parameters (pulse) defining the shader constant 'pulse' may be replaced by rgba values. You can find an example in this thread : https://www.ambiera.com/forum.php?t=3575 (glsl shaders for projects running in Windows mode). |
||||
|
Thanks Marc, pulse is given to the shader as vec4 array, I knew about rgba, but alpha has no impact, as v_fragColor seems to ignore it. Also, I was wondering whether there is any way to access the pixel under the current fragment, or, say access to the framebuffer, and not just the texturebuffer of the material? |
||||
|
Dieter, you are too kind because I'm afraid I couldn't help you. About applying custom-made shaders inside CCB I have thrown in the towel. It is too complicated for my little brain. However a few weeks ago I was able to create some interesting shaders for the animated soldier. They are based on some original ones found on GLSL tutorials published on the web. In this topic https://www.ambiera.com/forum.php?t=8705 I posted a comment with a link to my shared CCB tests uploaded on my OneDrive. In the subfolder SPACE key UP DOWN Demo, I included this shader :
While testing the GLSL shaders, I noticed that some of them activate the possibility to apply a normal map to the animated meshes (example : the soldier) while the CCB doc mentions that it is not possible (reference : normal map -> limitations). You made a nice job with your behavior to apply custom-made shader. Thank you for teaching your skills with this community. It is quite helpful. About the shaders, for the purpose of real-time testing, I prefer having the possibility to edit them inside an 'action -> Execute Java Script'. :-) |
||||
|
Dieter, may I suggest you to try this : Deselect the parameter "ZwriteEnable" for the selected node in the IrrLicht properties pane. |
||||
|
Thank you guys, appreciate it. ZWriteEnable off gives a weird effect, in which all alpha geometry, the grass and leaves, are in front of the shaded object, which is a mesh attached to the camera, like a filter, so it looks as if the terrain has a shader, but also everything else, except for alpha material meshes. Interesting, but something completely diffrent. The doc doesn't say much about the modes: base material type: usually 0 for the solid material. (2 for lightmap, 12 for additive transparency). So I tried them, 0 and 2 are solid when used with one texture, 12 is additive, just with the problem described initially. I then tried lots of numbers and found: the blendmode is solid below 30, except for 12. It is additive above 29, showing that it could blend correctly with the grass in place, but now the shader is not doing anything anymore (no animation). I keep on hacking... |
||||
|
Note, some related findings I posted here: https://www.ambiera.com/forum.php?t=8797 |
|