1 #ifndef EMBEDDED_RESOURCE_H
2 #define EMBEDDED_RESOURCE_H
11 static const char * embedded_screen_obj[] =
13 "# Blender v2.72 (sub 0) OBJ File: '' \n",
14 "# www.blender.org \n",
16 "v -1.000000 -1.000000 0.000000 \n",
17 "v 1.000000 -1.000000 0.000000 \n",
18 "v -1.000000 1.000000 0.000000 \n",
19 "v 1.000000 1.000000 0.000000 \n",
20 "vt 0.000000 0.000000 \n",
21 "vt 1.000000 0.000000 \n",
22 "vt 0.000000 1.000000 \n",
23 "vt 1.000000 1.000000 \n",
29 static size_t embedded_screen_obj_size = 15;
34 static const char * embedded_char_obj[] =
36 "# Blender v2.72 (sub 0) OBJ File: '' \n",
37 "# www.blender.org \n ",
39 "v 0.000000 0.000000 0.000000 \n ",
40 "v 1.000000 0.000000 0.000000 \n ",
41 "v 0.000000 1.000000 0.000000 \n ",
42 "v 1.000000 1.000000 0.000000 \n ",
43 "vt 0.000000 0.000000 \n ",
44 "vt 1.000000 0.000000 \n ",
45 "vt 0.000000 1.000000 \n ",
46 "vt 1.000000 1.000000 \n ",
52 static size_t embedded_char_obj_size = 15;
58 static const char * embedded_height_op_vert[] =
62 "uniform mat4 Projection; \n" ,
63 "uniform mat4 ModelView; \n" ,
64 "attribute vec3 Vertex; \n" ,
65 "attribute vec2 uv; \n" ,
66 "varying vec4 TexCoord; \n" ,
70 " vec4 vertex = vec4( Vertex , 1.0f); \n " ,
71 " TexCoord = vec4( uv , 0 , 0 ); \n " ,
72 " gl_Position = Projection * ModelView * vec4( Vertex.xyz , 1.0f); \n" ,
79 static const char * embedded_height_op_frag[] =
82 "#extension GL_EXT_texture_array : enable \n",
84 "uniform sampler2DArray tex_array; \n",
85 "uniform sampler2D height_map; \n",
86 "uniform float textures; \n",
87 "uniform float alpha_factor; \n",
88 "in vec4 TexCoord; \n",
92 " float elevation = 1 / textures; \n",
93 " float alpha_blend = elevation - (elevation / 5 ); \n",
94 " vec4 color0 = vec4(0,0,0,1); \n",
95 " vec4 color1 = vec4(0,0,0,1); \n",
96 " vec4 height = texture2D( height_map , TexCoord.st ); \n",
97 " float test = 0.30f * height.r + 0.59f * height.g + 0.11f * height.b; \n",
98 " test = height.r; \n",
100 " color0 = texture2DArray( tex_array , vec3( TexCoord.st , 0 ) ); \n",
101 " for( int count=0; count < textures; count++) \n",
103 " if( test > elevation * (count+1) ) \n ",
104 " color0 = texture2DArray( tex_array , vec3( TexCoord.st , (count+1) ) ); \n",
105 " if( test > alpha_blend * (count+1) ) \n",
106 " color1 = texture2DArray( tex_array , vec3( TexCoord.st , (count+1) ) ); \n",
109 " gl_FragColor = mix( color0 , color1 ,alpha_factor); \n",
116 #endif // EMBEDDED_RESOURCE_H