Closed coderextreme closed 1 year ago
Here's how I'd like to use shaders. Please let me know if it is NOT possible. It's nearly working now! Thanks!
<ComposedShader DEF="shader" language="GLSL">
<field name='cube' type='SFInt32' accessType='inputOutput' value='0'></field>
<field name='chromaticDispertion' accessType='initializeOnly' type='SFVec3f' value='0.98 1.0 1.033'></field>
<field name='bias' type='SFFloat' accessType='inputOutput' value='0.5'></field>
<field name='scale' type='SFFloat' accessType='inputOutput' value='0.5'></field>
<field name='power' type='SFFloat' accessType='inputOutput' value='2'></field>
<field name='a' type='SFFloat' accessType='inputOutput' value='10'></field>
<field name='b' type='SFFloat' accessType='inputOutput' value='1'></field>
<field name='c' type='SFFloat' accessType='inputOutput' value='20'></field>
<field name='d' type='SFFloat' accessType='inputOutput' value='20'></field>
<field name='tdelta' type='SFFloat' accessType='inputOutput' value='0'></field>
<field name='pdelta' type='SFFloat' accessType='inputOutput' value='0'></field>
<ShaderPart type="VERTEX">
<IS>
<connect nodeField="url" protoField="vertex"/>
</IS>
</ShaderPart>
<ShaderPart type='FRAGMENT'>
<IS>
<connect nodeField="url" protoField="fragment"/>
</IS>
</ShaderPart>
</ComposedShader>
Here's the dependent code:
<ExternProtoDeclare name="FlowerProto" url='"../personal/flowerproto.json#FlowerProto" "https://coderextreme.net/X3DJSONLD/src/main/personal/flowerproto.json#FlowerProto"'>
<field accessType='inputOutput' name='vertex' type='MFString'/>
<field accessType='inputOutput' name='fragment' type='MFString'/>
</ExternProtoDeclare>
<ProtoDeclare name="flower">
<ProtoBody>
<Group>
<ProtoInstance name="FlowerProto">
<fieldValue name="vertex" value='"../shaders/x_ite_flowers_chromatic.vs"'></fieldValue>
<fieldValue name="fragment" value='"../shaders/x_ite.fs"'></fieldValue>
</ProtoInstance>
</Group>
</ProtoBody>
</ProtoDeclare>
<ProtoInstance name="flower"/>
<ProtoInstance name="flower"/>
<ProtoInstance name="flower"/>
<ProtoInstance name="flower"/>
<ProtoInstance name="flower"/>
<ProtoInstance name="flower"/>
I am working on stripping out JQuery. It seems to want to stick it's nose into things.
As it turn out you have set X3D version of FlowerProto file, to 4.0, but the file contains a ComposedCubeMapTexture. In X3D4.0 there are changes in the field names to this texture, see:
Either go back to 3.3 or do changes the field names.
That fixed it! Thanks!
See:
https://coderextreme.net/X3DJSONLD/src/main/html/indexts.html
I believe the stars should be glass-like, not white.
Thanks for any help.
John
Your example HTML: