<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I believe I solved this by inlining the shader source code.  At least it fixed one other instance. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Sent from <a href="http://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;border:none;padding:0in'><br><b>From: </b><a href="mailto:highaspirations@hotmail.com">doug sanden</a><br><b>Sent: </b>Monday, January 11, 2016 6:46 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:freewrl-develop@lists.sourceforge.net">freewrl-develop@lists.sourceforge.net</a><br><b>Subject: </b>Re: [x3d-public] geo / bubbles shader scene</p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal>Thanks John for the screenshot. I'll look into that upside-down thing. Could be my matrix tinkering.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Standardized names - yes that's funny there are none. It makes shader programs browser-specific. Would be nice if they were standardized at least for GLSL and HLSL separately. X3Dom's looks 'not bad' for GLSL at first glance, but I'd have to try it out. </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-Doug</p><p class=MsoNormal>more..</p><p class=MsoNormal>I think glsl compilers will clean out/cull any unused uniform variables during compilation. </p><p class=MsoNormal>If so, then the browser would automatically paste in all the standard variables as uniform variables at the top of the user's declared shader script, compile, then loop through to see which standard uniforms survived.</p><p class=MsoNormal>For the ones that stuck, the browser would set them on each frame automatically. And update any changed user-declared fields.</p><p class=MsoNormal>Browsers are already doing this I think. So its just a matter of making sure we've all got the same set of standard variables, and they're all named the same - at least for GLSL and HLSL separately.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>________________________________________</p><p class=MsoNormal>From: John Carlson <yottzumm@gmail.com></p><p class=MsoNormal>Sent: January 11, 2016 2:46 PM</p><p class=MsoNormal>To: doug sanden</p><p class=MsoNormal>Cc: X3D Graphics public mailing list</p><p class=MsoNormal>Subject: Re: [x3d-public]  geo / bubbles shader scene</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Doug, it’s supposed to look like the this image:</p><p class=MsoNormal>http://coderextreme.net/reflectrefract.png</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>But your below modifications means that we should standardize our names for various matrices etc.  (fw_…) between X3D players so that our shader code is portable.  Does anyone want to take this up?  Also it would be good if we could coordinate with PlayCanvas.com on this as well.  I don’t want to modify my shaders for every single app I write and every browser I use.  Is there a good solution?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal>> On Jan 11, 2016, at 4:12 PM, doug sanden <highaspirations@hotmail.com> wrote:</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Q. is this what the geo.x3d/ bubbles ProgrammableShader sample is supposed to look like?</p><p class=MsoNormal>> http://dug9.users.sourceforge.net/web3d/tests/Bubbles_shaders/geo/geoPshaderInline10.png</p><p class=MsoNormal>> -Doug</p><p class=MsoNormal>> more..</p><p class=MsoNormal>> freewrl wasn't showing the sphere, so I hacked the shaders until I got something, then tinkered to get it close to the original scene.</p><p class=MsoNormal>> 1. I changed from ComposedShader to ProgramShader (not sure that was necessary)</p><p class=MsoNormal>> 2. dropped the cube SFInt32 field</p><p class=MsoNormal>> 3. substituted fw_ names for things like modelviewmatrix ie fw_ModelViewMatrix</p><p class=MsoNormal>> 4. explicitly multiplied projection * modelview rather than assuming it's already in context ie fw_ProjectionMatrix * fw_ModelViewMatrix</p><p class=MsoNormal>> 5. avoided mat3 and used the original mat4</p><p class=MsoNormal>> 6. replaced 'uniform samplerCube cube;' with 'uniform samplerCube fw_Texture_unit0;'</p><p class=MsoNormal>>   and textureCube(cube,... with textureCube(fw_Texture_unit0,...</p><p class=MsoNormal>> Resulting freewrl-compatible scene:</p><p class=MsoNormal>> http://dug9.users.sourceforge.net/web3d/tests/Bubbles_shaders/geo/geoPShaderInline10.x3d</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> more..</p><p class=MsoNormal>> I don't know if there's something in the specs saying what the common matrices and texture units are supposed to be called.</p><p class=MsoNormal>> If so freewrlians didn't get the memo. Hence the fw_ names.</p><p class=MsoNormal>> Q. where is that -names for modelviewmatrix etc- in any specs?</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> ________________________________________</p><p class=MsoNormal>> From: x3d-public <x3d-public-bounces@web3d.org> on behalf of doug sanden <highaspirations@hotmail.com></p><p class=MsoNormal>> Sent: January 10, 2016 8:54 AM</p><p class=MsoNormal>> To: John Carlson; X3D Graphics public mailing list</p><p class=MsoNormal>> Subject: Re: [x3d-public] fill in what shading languages are available</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Could someone fill in what shading languages are available for those</p><p class=MsoNormal>>> X3D players which support programmable shaders on this</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> page: http://www.web3d.org/wiki/index.php/Player_support_for_X3D_components</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> _                      FreeWRL</p><p class=MsoNormal>> Programmable</p><p class=MsoNormal>> _ Shaders      partial^</p><p class=MsoNormal>> GLSL                yes</p><p class=MsoNormal>> HLSL                no</p><p class=MsoNormal>> Cg                    no</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> ^ and a subset of Level 1</p><p class=MsoNormal>> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shaders.html#SupportLevels</p><p class=MsoNormal>> ComposedShader    yes</p><p class=MsoNormal>> ProgramShader        yes</p><p class=MsoNormal>> PackagedShader       no</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> more..</p><p class=MsoNormal>> http://freewrl.sourceforge.net/FreeX3D/Component_ProgrammableShaders.html</p><p class=MsoNormal>> On behalf of the freewrl opensource community, I report my best knowledge today FreeWRL supports GLSL shading language only, Composed and Program shaders only.</p><p class=MsoNormal>> Or more correctly aspires to. Your Geo.x3d example</p><p class=MsoNormal>> http://coderextreme.net/bug/geo.x3d</p><p class=MsoNormal>> of cubemap shading in a ComposedShader isn't working right now in freewrl, and I'm looking into that.</p><p class=MsoNormal>> Other samples of ProgramShaders and ComposedShaders do work in freewrl:</p><p class=MsoNormal>> http://dug9.users.sourceforge.net/web3d/tests/ProgrammableShaders/flutter2-ProgramShader.x3d</p><p class=MsoNormal>> http://dug9.users.sourceforge.net/web3d/tests/ProgrammableShaders/flutter2-ComposedShader.x3d</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Thanks,</p><p class=MsoNormal>> -Doug</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Player support for X3D components - Web3D.org</p><p class=MsoNormal>>> www.web3d.org</p><p class=MsoNormal>>> The Extensible 3D (X3D) Graphics standard has many capabilities. X3D</p><p class=MsoNormal>>> components are modular collections of nodes that make it easier for</p><p class=MsoNormal>>> software to gradually ...</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> Thanks,</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>> John</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>> _______________________________________________</p><p class=MsoNormal>> x3d-public mailing list</p><p class=MsoNormal>> x3d-public@web3d.org</p><p class=MsoNormal>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org</p><p class=MsoNormal>> _______________________________________________</p><p class=MsoNormal>> x3d-public mailing list</p><p class=MsoNormal>> x3d-public@web3d.org</p><p class=MsoNormal>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>