<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-11-12 15:40 GMT+01:00 doug sanden <span dir="ltr"><<a href="mailto:highaspirations@hotmail.com" target="_blank">highaspirations@hotmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Andreas,<br>
(please forward to x3d-public - I'm not subscribed)<br>
Spec change?<br>
There was that specification complaint by a few (Michalis and Doug): replace vs modulation in lighting model:<br>
currently replace:<br>
texture > CPV > material<br>
modulate:<br>
texture x CPV x material<br>
Modulate would in theory give us more permutations to play with, but would break old scenes.<br>
<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/SharkLefty.x3d" rel="noreferrer" target="_blank">http://x3dgraphics.com/<wbr>examples/X3dForWebAuthors/<wbr>KelpForestExhibit/SharkLefty.<wbr>x3d</a><br>
- has material, CPV and texture<br>
<br>
Same with transparency - it could be modulated with spec change, breaking old scenes.<br>
For example if you have a texture with transparency, and on top of that you want to apply an overall material transparency, it doesn't work because image.transparancy > material.transparency<br>
<a href="http://dug9.users.sourceforge.net/web3d/tests/DebateModulateAlpha/" rel="noreferrer" target="_blank">http://dug9.users.sourceforge.<wbr>net/web3d/tests/<wbr>DebateModulateAlpha/</a><br>
- 2 scenes with image transparency. _05 has material transparency set to .5<br>
- I have this scene working in freewrl right now with an internal half-modulation setting, at the expense of some other scenarios not rendering as per specs.<br>
- the _10 (material transparency 1.0) scenes: freewrl and view3dscene show no sphere (invisible)<br>
-- Octaga, Instant, H3D show sphere with texture transparency pattern<br>
-- Vivaty white-screens<br>
<br></blockquote><div><br></div><div>It seems to me that this issue (how "Material.transparency" interacts with texture alpha) is an independent problem from the one that started this thread.</div><div><br></div><div>In the case of <a href="http://x3dgraphics.com/examples/X3dForAdvancedModeling/ShayDPixel/ShayDPixelVersion2Index.html">http://x3dgraphics.com/examples/X3dForAdvancedModeling/ShayDPixel/ShayDPixelVersion2Index.html</a> model, it does not modify Material.transparency, so it is always default 1.0.</div><div><br></div><div>The problem with <a href="http://x3dgraphics.com/examples/X3dForAdvancedModeling/ShayDPixel/ShayDPixelVersion2Index.html">http://x3dgraphics.com/examples/X3dForAdvancedModeling/ShayDPixel/ShayDPixelVersion2Index.html</a> is that some viewers may use blending when a texture with alpha channel (*any* alpha channel, even one filled with constant 1.0) is present. So the question is whether to differentiate between "has alpha channel and we should do blending" or "does not have alpha channel and blending is not necessary" is done by analyzing the contents (like your <span style="font-size:12.8px">sniffImageChannels_bruteForce(</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">) , CGE has something equivalent) or by looking at image header.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">So, here the decision is about "whether to use blending or not".</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">It is not about "which lighting equations to use". In the case of lighting equations, my proposal ("always modulate", <a href="https://castle-engine.sourceforge.io/x3d_multi_texturing.php#section_default_texture_mode">https://castle-engine.sourceforge.io/x3d_multi_texturing.php#section_default_texture_mode</a> ) would mean that it doesn't matter whether the X3D browser analyses the image contents or not. That's a comfortable situation, when the equations work the same, regardless of whether the browser analyzes the image contents.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">But in the case of "</span><span style="font-size:12.8px">whether to use blending or not", we don't have such easy solution. Honestly, I'm not sure what should the specification say. I know what my engine is doing (detect alpha by analyzing image contents, and allow to override by ImageTexture.alphaChannel field, <a href="https://castle-engine.sourceforge.io/x3d_implementation_texturing_extensions.php#section_ext_alpha_channel_detection">https://castle-engine.sourceforge.io/x3d_implementation_texturing_extensions.php#section_ext_alpha_channel_detection</a> ), and it seems to work well.</span></div><div><br></div><div>Hm, I realize that my lengthy explanation possibly complicated the whole issue even more :) Sorry about that :)<br></div><div><br></div><div>Regards,</div><div>Michalis</div></div></div></div>