File t.c changed (mode: 100644) (index ff43bc6..50ba63c) |
... |
... |
OIIO_NAMESPACE_USING |
14 |
14 |
|
|
15 |
15 |
|
|
16 |
16 |
|
|
17 |
|
const GLchar *vert_src ="\n" \ |
|
18 |
|
"#version 330 \n" \ |
|
19 |
|
" #extension GL_ARB_explicit_uniform_location : enable \n" \ |
|
20 |
|
" out vec2 kn; \n" \ |
|
21 |
|
" \n" \ |
|
22 |
|
" out vec4 knn; \n" \ |
|
23 |
|
" layout(location = 1) in vec2 in_p; \n" \ |
|
24 |
|
" layout(location = 0) in vec4 in_position; \n" \ |
|
25 |
|
" layout(location =10)uniform mat4 projection; \n" \ |
|
26 |
|
"void main() \n" \ |
|
27 |
|
"{ \n" \ |
|
28 |
|
" gl_Position = projection*in_position; \n" \ |
|
29 |
|
"knn=in_position ; \n" \ |
|
30 |
|
"kn=in_p ; \n" \ |
|
31 |
|
"// gl_Position = in_position; \n" \ |
|
32 |
|
"} \n" ; |
|
33 |
|
const GLchar *frag_src ="\n" \ |
|
34 |
|
"#version 330 \n" \ |
|
35 |
|
" #extension GL_ARB_explicit_uniform_location : enable \n" \ |
|
36 |
|
"layout(location =11)uniform sampler2D t; \n" \ |
|
37 |
|
" vec4 b; \n" \ |
|
38 |
|
" in vec4 knn; \n" \ |
|
39 |
|
" in vec2 kn; \n" \ |
|
40 |
|
"void main (void) \n" \ |
|
41 |
|
"{ \n" \ |
|
42 |
|
" if(gl_FrontFacing) \n" \ |
|
43 |
|
" gl_FragColor = texture( t, kn); \n" \ |
|
44 |
|
"else discard; \n" \ |
|
45 |
|
"} \n"; |
|
|
17 |
|
const GLchar *vert_src = R"( |
|
18 |
|
#version 330 |
|
19 |
|
#extension GL_ARB_explicit_uniform_location : enable |
|
20 |
|
out vec2 kn; |
|
21 |
|
|
|
22 |
|
out vec4 knn; |
|
23 |
|
layout(location = 1) in vec2 in_p; |
|
24 |
|
layout(location = 0) in vec4 in_position; |
|
25 |
|
layout(location =10)uniform mat4 projection; |
|
26 |
|
void main() |
|
27 |
|
{ |
|
28 |
|
gl_Position = projection*in_position; |
|
29 |
|
knn=in_position ; |
|
30 |
|
kn=in_p ; |
|
31 |
|
// gl_Position = in_position; |
|
32 |
|
} |
|
33 |
|
)"; |
|
34 |
|
|
|
35 |
|
const GLchar *frag_src =R"( |
|
36 |
|
#version 330 |
|
37 |
|
#extension GL_ARB_explicit_uniform_location : enable |
|
38 |
|
layout(location =11)uniform sampler2D t; |
|
39 |
|
vec4 b; |
|
40 |
|
in vec4 knn; |
|
41 |
|
in vec2 kn; |
|
42 |
|
void main (void) { |
|
43 |
|
if(gl_FrontFacing) |
|
44 |
|
gl_FragColor = texture( t, kn); |
|
45 |
|
else discard; |
|
46 |
|
} |
|
47 |
|
)"; |
46 |
48 |
|
|
47 |
49 |
|
|
48 |
50 |
|
|
|
... |
... |
c.nchannels=4; |
204 |
206 |
c.x=0; |
c.x=0; |
205 |
207 |
c.y=0; |
c.y=0; |
206 |
208 |
c.format=TypeDesc::UINT8; |
c.format=TypeDesc::UINT8; |
207 |
|
|
|
|
209 |
|
GLfloat ok[] ={0.4,0.4,0.8}; |
208 |
210 |
ImageBuf k(c,trr); |
ImageBuf k(c,trr); |
209 |
211 |
ImageBuf h("161208ap5410_fpx.jpg"); |
ImageBuf h("161208ap5410_fpx.jpg"); |
210 |
212 |
h.read(); |
h.read(); |
211 |
213 |
k.copy_pixels(h); |
k.copy_pixels(h); |
212 |
214 |
h.clear (); |
h.clear (); |
213 |
|
//ImageBufAlgo::noise(k,"gaussian"); |
|
|
215 |
|
//ImageBufAlgo::render_text(k,34,157,"2.75",129,"/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf",ok); |
214 |
216 |
|
|
215 |
217 |
|
|
216 |
218 |
GLuint frag_shader, vert_shader; |
GLuint frag_shader, vert_shader; |