-
Notifications
You must be signed in to change notification settings - Fork 1
/
webvr.x3d
71 lines (66 loc) · 2.39 KB
/
webvr.x3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<group id="Webvr__stereoRt" render="true">
<group def="left">
<shape>
<appearance>
<renderedtexture id="Webvr__rtLeft"
stereoMode="LEFT_EYE" update="ALWAYS"
dimensions="1024 1024 4" repeatS="false" repeatT="false">
<viewpoint use="$VIEWPOINT" containerfield="viewpoint"></viewpoint>
<background use="$BACKGROUND" containerfield="background"></background>
<group use="$SCENE" containerfield="scene"></group>
</renderedtexture>
<composedshader>
<field name="tex" type="SFInt32" value="0"></field>
<field name="eye" type="SFInt32" value="-1.0"></field>
<shaderpart def="vert" type="VERTEX">
attribute vec3 position;
attribute vec2 texcoord;
uniform mat4 modelViewProjectionMatrix;
uniform float eye;
varying vec2 fragTexCoord;
void main()
{
vec2 pos = sign(position.xy);
fragTexCoord = texcoord;
gl_Position = vec4((pos.x + 1.0 * eye) / 2.0, pos.y, 0.0, 1.0);
}
</shaderpart>
<shaderpart def="frag" type="FRAGMENT">
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D tex;
varying vec2 fragTexCoord;
void main()
{
gl_FragColor = texture2D(tex, fragTexCoord);
}
</shaderpart>
</composedshader>
</appearance>
<plane solid="false"></plane>
</shape>
</group>
<group def="right">
<shape>
<appearance>
<renderedtexture id="Webvr__rtRight"
stereoMode="RIGHT_EYE" update="ALWAYS"
dimensions="1024 1024 4" repeatS="false" repeatT="false">
<viewpoint use="$VIEWPOINT" containerfield="viewpoint"></viewpoint>
<background use="$BACKGROUND" containerfield="background"></background>
<group use="$SCENE" containerfield="scene"></group>
</renderedtexture>
<composedshader>
<field name="tex" type="SFInt32" value="0"></field>
<field name="eye" type="SFInt32" value="1.0"></field>
<shaderpart use="vert" type="VERTEX">
</shaderpart>
<shaderpart use="frag" type="FRAGMENT">
</shaderpart>
</composedshader>
</appearance>
<plane solid="false"></plane>
</shape>
</group>
</group>