~holger-seelig/titania-library/trunk

« back to all changes in this revision

Viewing changes to Tests/Components/Shaders/Fields.x3d

  • Committer: Holger Seelig
  • Date: 2017-09-18 02:55:31 UTC
  • Revision ID: holger.seelig@yahoo.de-20170918025531-n60g34kd9bfs41t1
Updated prototypes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
 
3
<X3D profile='Full' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
 
4
  <head>
 
5
    <meta name='comment' content='World of Titania'/>
 
6
    <meta name='created' content='Sat, 26 Dec 2015 20:37:24 GMT'/>
 
7
    <meta name='creator' content='Holger Seelig'/>
 
8
    <meta name='generator' content='Titania V1.2.2, http://titania.create3000.de'/>
 
9
    <meta name='modified' content='Sat, 02 Jan 2016 03:04:18 GMT'/>
 
10
  </head>
 
11
  <Scene>
 
12
    <WorldInfo>
 
13
      <MetadataSet DEF='Titania'
 
14
          name='Titania'
 
15
          reference='http://titania.create3000.de'>
 
16
        <MetadataSet DEF='NavigationInfo' containerField='value'
 
17
            name='NavigationInfo'
 
18
            reference='http://titania.create3000.de'>
 
19
          <MetadataString DEF='type' containerField='value'
 
20
              name='type'
 
21
              reference='http://titania.create3000.de'
 
22
              value='"EXAMINE"'/>
 
23
        </MetadataSet>
 
24
        <MetadataSet DEF='Viewpoint' containerField='value'
 
25
            name='Viewpoint'
 
26
            reference='http://titania.create3000.de'>
 
27
          <MetadataDouble DEF='position' containerField='value'
 
28
              name='position'
 
29
              reference='http://titania.create3000.de'
 
30
              value='0, 0, 10'/>
 
31
          <MetadataDouble DEF='orientation' containerField='value'
 
32
              name='orientation'
 
33
              reference='http://titania.create3000.de'
 
34
              value='0, 0, 1, 0'/>
 
35
          <MetadataDouble DEF='centerOfRotation' containerField='value'
 
36
              name='centerOfRotation'
 
37
              reference='http://titania.create3000.de'
 
38
              value='0, 0, 0'/>
 
39
        </MetadataSet>
 
40
      </MetadataSet>
 
41
    </WorldInfo>
 
42
    <Transform DEF='Sphere'>
 
43
      <Shape>
 
44
        <Appearance>
 
45
          <ComposedShader DEF='CobwebShader'
 
46
              language='GLSL'>
 
47
            <field accessType='initializeOnly' type='SFBool' name='sfbool'/>
 
48
            <field accessType='initializeOnly' type='SFColor' name='sfcolor'/>
 
49
            <field accessType='initializeOnly' type='SFColorRGBA' name='sfcolorrgba'/>
 
50
            <field accessType='initializeOnly' type='SFDouble' name='sfdouble'/>
 
51
            <field accessType='initializeOnly' type='SFFloat' name='sffloat'/>
 
52
            <field accessType='initializeOnly' type='SFImage' name='sfimage' value='3 5 2 0xffff 0xffff 0xffff 0 0 0xffff 0xffff 0xffff 0xffff 0 0 0xffff 0xffff 0xffff 0xffff'/>
 
53
            <field accessType='initializeOnly' type='SFInt32' name='sfint32'/>
 
54
            <field accessType='initializeOnly' type='SFMatrix3d' name='sfmatrix3d'/>
 
55
            <field accessType='initializeOnly' type='SFMatrix3f' name='sfmatrix3f'/>
 
56
            <field accessType='initializeOnly' type='SFMatrix4d' name='sfmatrix4d'/>
 
57
            <field accessType='initializeOnly' type='SFMatrix4f' name='sfmatrix4f'/>
 
58
            <field accessType='initializeOnly' type='SFNode' name='sfnode'>
 
59
              <ImageTexture DEF='_1'
 
60
                  url='"../images/ubuntu.png"'/>
 
61
            </field>
 
62
            <field accessType='initializeOnly' type='SFRotation' name='sfrotation'/>
 
63
            <field accessType='initializeOnly' type='SFString' name='sfstring'/>
 
64
            <field accessType='initializeOnly' type='SFTime' name='sftime'/>
 
65
            <field accessType='initializeOnly' type='SFVec2d' name='sfvec2d'/>
 
66
            <field accessType='initializeOnly' type='SFVec2f' name='sfvec2f'/>
 
67
            <field accessType='initializeOnly' type='SFVec3d' name='sfvec3d'/>
 
68
            <field accessType='initializeOnly' type='SFVec3f' name='sfvec3f'/>
 
69
            <field accessType='initializeOnly' type='SFVec4d' name='sfvec4d'/>
 
70
            <field accessType='initializeOnly' type='SFVec4f' name='sfvec4f'/>
 
71
            <field accessType='initializeOnly' type='MFBool' name='mfbool'/>
 
72
            <field accessType='initializeOnly' type='MFColor' name='mfcolor'/>
 
73
            <field accessType='initializeOnly' type='MFColorRGBA' name='mfcolorrgba'/>
 
74
            <field accessType='initializeOnly' type='MFDouble' name='mfdouble'/>
 
75
            <field accessType='initializeOnly' type='MFFloat' name='mffloat'/>
 
76
            <field accessType='initializeOnly' type='MFImage' name='mfimage' value='3 5 2 0xffff 0xffff 0xffff 0 0 0xffff 0xffff 0xffff 0xffff 0 0 0xffff 0xffff 0xffff 0xffff'/>
 
77
            <field accessType='initializeOnly' type='MFInt32' name='mfint32'/>
 
78
            <field accessType='initializeOnly' type='MFMatrix3d' name='mfmatrix3d'/>
 
79
            <field accessType='initializeOnly' type='MFMatrix3f' name='mfmatrix3f'/>
 
80
            <field accessType='initializeOnly' type='MFMatrix4d' name='mfmatrix4d'/>
 
81
            <field accessType='initializeOnly' type='MFMatrix4f' name='mfmatrix4f'/>
 
82
            <field accessType='initializeOnly' type='MFNode' name='mfnode'>
 
83
              <ImageTexture USE='_1'/>
 
84
            </field>
 
85
            <field accessType='initializeOnly' type='MFRotation' name='mfrotation'/>
 
86
            <field accessType='initializeOnly' type='MFString' name='mfstring'/>
 
87
            <field accessType='initializeOnly' type='MFTime' name='mftime'/>
 
88
            <field accessType='initializeOnly' type='MFVec2d' name='mfvec2d'/>
 
89
            <field accessType='initializeOnly' type='MFVec2f' name='mfvec2f'/>
 
90
            <field accessType='initializeOnly' type='MFVec3d' name='mfvec3d'/>
 
91
            <field accessType='initializeOnly' type='MFVec3f' name='mfvec3f'/>
 
92
            <field accessType='initializeOnly' type='MFVec4d' name='mfvec4d'/>
 
93
            <field accessType='initializeOnly' type='MFVec4f' name='mfvec4f'/>
 
94
            <ShaderPart DEF='CobweVertex'>
 
95
<![CDATA[data:text/plain,
 
96
 
 
97
precision mediump float;
 
98
 
 
99
uniform mat4 x3d_ProjectionMatrix;
 
100
uniform mat4 x3d_ModelViewMatrix;
 
101
 
 
102
attribute vec4 x3d_TexCoord;
 
103
attribute vec4 x3d_Vertex;
 
104
 
 
105
varying vec4 texCoord;
 
106
 
 
107
void
 
108
main ()
 
109
{
 
110
        gl_Position = x3d_ProjectionMatrix * x3d_ModelViewMatrix * x3d_Vertex;
 
111
 
 
112
        texCoord = x3d_TexCoord;
 
113
}]]> 
 
114
            </ShaderPart>
 
115
            <ShaderPart DEF='CobwebFragment'
 
116
                type='FRAGMENT'>
 
117
<![CDATA[data:text/plain,
 
118
 
 
119
precision mediump float;
 
120
 
 
121
uniform int       sfbool;
 
122
uniform vec3      sfcolor;
 
123
uniform vec4      sfcolorrgba;
 
124
uniform float     sfdouble;
 
125
uniform float     sffloat;
 
126
uniform int       sfimage [18];
 
127
uniform int       sfint32;
 
128
uniform mat3      sfmatrix3d;
 
129
uniform mat3      sfmatrix3f;
 
130
uniform mat4      sfmatrix4d;
 
131
uniform mat4      sfmatrix4f;
 
132
uniform sampler2D sfnode;
 
133
uniform vec4      sfrotation;
 
134
uniform float     sftime;
 
135
uniform vec2      sfvec2d;
 
136
uniform vec2      sfvec2f;
 
137
uniform vec3      sfvec3d;
 
138
uniform vec3      sfvec3f;
 
139
uniform vec4      sfvec4d;
 
140
uniform vec4      sfvec4f;
 
141
uniform int       mfbool [2];
 
142
uniform vec3      mfcolor [2];
 
143
uniform vec4      mfcolorrgba [2];
 
144
uniform float     mfdouble [2];
 
145
uniform float     mffloat [2];
 
146
uniform int       mfimage [36];
 
147
uniform int       mfint32 [2];
 
148
uniform mat3      mfmatrix3d [2];
 
149
uniform mat3      mfmatrix3f [2];
 
150
uniform mat4      mfmatrix4d [2];
 
151
uniform mat4      mfmatrix4f [2];
 
152
uniform sampler2D mfnode [2];
 
153
uniform vec4      mfrotation [2];
 
154
uniform vec4      mfstring [2];
 
155
uniform float     mftime [2];
 
156
uniform vec2      mfvec2d [2];
 
157
uniform vec2      mfvec2f [2];
 
158
uniform vec3      mfvec3d [2];
 
159
uniform vec3      mfvec3f [2];
 
160
uniform vec4      mfvec4d [2];
 
161
uniform vec4      mfvec4f [2];
 
162
 
 
163
 
 
164
 
 
165
 
 
166
 
 
167
 
 
168
varying vec4 texCoord;
 
169
 
 
170
void
 
171
main ()
 
172
{
 
173
        float x = 0.0;
 
174
 
 
175
        x += float (sfbool);
 
176
        x += sfcolor .r;
 
177
        x += sfcolorrgba .r;
 
178
        x += sfdouble;
 
179
        x += sffloat;
 
180
        x += float (sfimage [0]);
 
181
        x += float (sfint32);
 
182
        x += sfmatrix3d [0] .x;
 
183
        x += sfmatrix3f [0] .x;
 
184
        x += sfmatrix4d [0] .x;
 
185
        x += sfmatrix4f [0] .x;
 
186
        x += texture2D (sfnode, vec2 (0, 0)) .r;
 
187
        x += sfrotation [0];
 
188
        x += sftime;
 
189
        x += sfvec2d [0];
 
190
        x += sfvec2f [0];
 
191
        x += sfvec3d [0];
 
192
        x += sfvec3f [0];
 
193
        x += sfvec4d [0];
 
194
        x += sfvec4f [0];
 
195
        x += float (mfbool [0]);
 
196
        x += mfcolor [0] .r;
 
197
        x += mfcolorrgba [0] .r;
 
198
        x += mfdouble [0];
 
199
        x += mffloat [0];
 
200
        x += float (mfimage [0]);
 
201
        x += float (mfint32 [0]);
 
202
        x += mfmatrix3d [0] [0] .x;
 
203
        x += mfmatrix3f [0] [0] .x;
 
204
        x += mfmatrix4d [0] [0] .x;
 
205
        x += mfmatrix4f [0] [0] .x;
 
206
        x += texture2D (mfnode [0], vec2 (0, 0)) .r;
 
207
        x += mfrotation [0] [0];
 
208
        x += mftime [0];
 
209
        x += mfvec2d [0] [0];
 
210
        x += mfvec2f [0] [0];
 
211
        x += mfvec3d [0] [0];
 
212
        x += mfvec3f [0] [0];
 
213
        x += mfvec4d [0] [0];
 
214
        x += mfvec4f [0] [0];
 
215
 
 
216
 
 
217
        x *= 0.00001;
 
218
 
 
219
 
 
220
 
 
221
        vec3 color   = vec3 (texture2D (mfnode [0], texCoord .st));
 
222
        gl_FragColor = vec4 (color, 1.0 + x);
 
223
}
 
224
]]> 
 
225
            </ShaderPart>
 
226
          </ComposedShader>
 
227
        </Appearance>
 
228
        <Sphere/>
 
229
      </Shape>
 
230
    </Transform>
 
231
  </Scene>
 
232
</X3D>