0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / tests / v3d / glsl / texture_multi1
CommitLineData
cc8cbabe 1puts "========"
2puts "0028912: Visualization, TKOpenGl - multi-texture support"
3puts "========"
4
5pload MODELING VISUALIZATION
6
7set aShaderVert "
8THE_SHADER_OUT vec2 TexCoord;
9void main() {
10 TexCoord = occTexCoord.st;
11 gl_Position = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * occVertex;
12}"
13
14set aShaderFrag "
15uniform sampler2D occSampler1;
16uniform sampler2D occSampler2;
17uniform sampler2D occSampler3;
18THE_SHADER_IN vec2 TexCoord;
19void main() {
20 if (TexCoord.s < 0.5 && TexCoord.t < 0.5) { occFragColor = occTexture2D(occSampler0, TexCoord.st); }
21 else if (TexCoord.s < 0.5 && TexCoord.t >= 0.5) { occFragColor = occTexture2D(occSampler1, TexCoord.st); }
22 else if (TexCoord.s >= 0.5 && TexCoord.t < 0.5) { occFragColor = occTexture2D(occSampler2, TexCoord.st); }
23 else { occFragColor = occTexture2D(occSampler3, TexCoord.st); }
24}"
25
26# draw a box
27box b 1 2 3
28vclear
8e0a2b19 29vclose ALL
cc8cbabe 30vinit View1
31vaxo
32vdisplay -dispMode 1 b
33vfit
34vrotate 0.2 0.0 0.0
35
36# take snapshot with built-in shader
37vtexture b -tex0 3 -tex1 4 -tex2 5 -tex3 6
38vdump $::imagedir/${::casename}_normal.png
39
8e0a2b19 40#vshaderprog b $aShaderVert $aShaderFrag
41vshaderprog b -vert $aShaderVert -frag $aShaderFrag
cc8cbabe 42vdump $::imagedir/${::casename}_multi.png