質問編集履歴

3

更新

2019/04/23 12:41

投稿

miiichat
miiichat

スコア72

test CHANGED
File without changes
test CHANGED
@@ -16,15 +16,7 @@
16
16
 
17
17
  ```
18
18
 
19
- Compile Error infragment shader
19
+
20
-
21
- ERROR: 0:7: 'function' : is removed in Forward Compatible context texture2D
22
-
23
- ERROR: 0:7: 'texture2D' : no matching overloaded function found (using implicit conversion)
24
-
25
- ERROR: 0:7: 'texture2D' : function is not known
26
-
27
- ERROR: 0:6: 'assign' : cannot convert from 'const highp float' to 'FragUserData 4-component vector of highp float'
28
20
 
29
21
  ```
30
22
 
@@ -60,11 +52,11 @@
60
52
 
61
53
  out vec4 fragment;
62
54
 
63
- uniform sampler2D texture;
55
+ uniform sampler2D tex;
64
56
 
65
57
  void main(void){
66
58
 
67
- fragment = texture2D(texture, vuv);
59
+ fragment = texture(tex, vuv);
68
60
 
69
61
  }
70
62
 
@@ -594,7 +586,7 @@
594
586
 
595
587
  glBindTexture(GL_TEXTURE_2D, 0);
596
588
 
597
- int textureLocation = glGetUniformLocation(program, "texture");
589
+ int textureLocation = glGetUniformLocation(program, "tex");
598
590
 
599
591
  glUniform1i(textureLocation, 0);
600
592
 

2

更新

2019/04/23 12:40

投稿

miiichat
miiichat

スコア72

test CHANGED
File without changes
test CHANGED
@@ -18,19 +18,13 @@
18
18
 
19
19
  Compile Error infragment shader
20
20
 
21
- ERROR: 0:? : 'variable' : is removed in Forward Compatible context gl_FragColor
22
-
23
- ERROR: 0:6: 'function' : is removed in Forward Compatible context texture2D
21
+ ERROR: 0:7: 'function' : is removed in Forward Compatible context texture2D
24
-
22
+
25
- ERROR: 0:6: 'texture2D' : no matching overloaded function found (using implicit conversion)
23
+ ERROR: 0:7: 'texture2D' : no matching overloaded function found (using implicit conversion)
26
-
24
+
27
- ERROR: 0:6: 'texture2D' : function is not known
25
+ ERROR: 0:7: 'texture2D' : function is not known
28
-
26
+
29
- ERROR: 0:5: 'assign' : cannot convert from 'const mediump float' to 'FragColor 4-component vector of mediump float'
27
+ ERROR: 0:6: 'assign' : cannot convert from 'const highp float' to 'FragUserData 4-component vector of highp float'
30
-
31
-
32
-
33
-
34
28
 
35
29
  ```
36
30
 

1

追加

2019/04/23 12:34

投稿

miiichat
miiichat

スコア72

test CHANGED
File without changes
test CHANGED
@@ -64,11 +64,13 @@
64
64
 
65
65
  in vec2 vuv;
66
66
 
67
+ out vec4 fragment;
68
+
67
69
  uniform sampler2D texture;
68
70
 
69
71
  void main(void){
70
72
 
71
- gl_FragColor = texture2D(texture, vuv);
73
+ fragment = texture2D(texture, vuv);
72
74
 
73
75
  }
74
76
 
@@ -250,7 +252,9 @@
250
252
 
251
253
  }
252
254
 
255
+ glBindFragDataLocation(program, 0, "fragment");
256
+
253
- glLinkProgram(program);
257
+ glLinkProgram(program);
254
258
 
255
259
 
256
260