vertex-shader

Pyglet shaders not working, keep erroring

五迷三道 提交于 2021-01-29 09:03:01
问题 so i am following a tutorial series on pyglet but i cant make shaders because it causes errors v Traceback (most recent call last): File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 20, in <module> window=window1(1280, 720,"tutorial", resizable=True) File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 9, in __init__ self.triangle=Triangle() File "/home/awesomenoob/Coding/Python/Triangle.py", line 52, in __init__ glUseProgram(shader) File "/home/awesomenoob/.local

Pyglet shaders not working, keep erroring

空扰寡人 提交于 2021-01-05 07:07:48
问题 so i am following a tutorial series on pyglet but i cant make shaders because it causes errors v Traceback (most recent call last): File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 20, in <module> window=window1(1280, 720,"tutorial", resizable=True) File "/home/awesomenoob/Coding/Python/window_with_shade.py", line 9, in __init__ self.triangle=Triangle() File "/home/awesomenoob/Coding/Python/Triangle.py", line 52, in __init__ glUseProgram(shader) File "/home/awesomenoob/.local

lwjgl 3 , glUniformMatrix4 causes jre to crash

独自空忆成欢 提交于 2020-06-15 06:50:30
问题 I'm using lwjgl 3 and learning modern opengl (3). I want to send a uniform matrix to the vertex shader so i can apply transformations. I tried that and the program crashes with this error # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000073a9820d, pid=8644, tid=2760 # # JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode

lwjgl 3 , glUniformMatrix4 causes jre to crash

空扰寡人 提交于 2020-06-15 06:50:27
问题 I'm using lwjgl 3 and learning modern opengl (3). I want to send a uniform matrix to the vertex shader so i can apply transformations. I tried that and the program crashes with this error # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000073a9820d, pid=8644, tid=2760 # # JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode

How can I find a list of all the uniforms in OpenGL es 2.0 vertex shader pro

喜你入骨 提交于 2020-06-09 17:07:05
问题 I'm trying to learn how to program vertex shaders. In Apple's sample project they have a line to set a glUniform1f(uniforms[UNIFORM_TRANSLATE], (Glfloat)transY); Then this value is used in // value passt in f // glUniform1f(uniforms[UNIFORM_TRANSLATE](Glfloat)transY); uniform float translate; void main() { gl_Position.y+=sin( translate); … I was unable to find a list of all uniforms of all the uniforms. Does any one know where I can find a list of all the uniforms and a good book or tutorial

OpenGL gluLookat not working with shaders on

一世执手 提交于 2020-02-05 13:57:08
问题 When i want to use gluLookat and have the shaders on it doesnt move the "camera" when i turn the shaders off it works correctly. Is there something missing in my shaders, i cant figure out what. void display(void) { glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.8, 0.8, 0.8, 0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0.5,0,1,0.5,0,0,0,1,0); glColor3f(0, 0, 0); glDrawArrays(GL_TRIANGLES, 0, 6); glDrawArrays(GL_LINES, 6, 6); glDrawArrays(GL_TRIANGLES, 12,6); glDrawArrays(GL_LINES

Why does OpenGL drawing fail when vertex attrib array zero is disabled?

痞子三分冷 提交于 2020-01-22 17:48:12
问题 I was having extreme trouble getting a vertex shader of mine to run under OpenGL 3.3 core on an ATI driver: #version 150 uniform mat4 graph_matrix, view_matrix, proj_matrix; uniform bool align_origin; attribute vec2 graph_position; attribute vec2 screen_position; attribute vec2 texcoord0; attribute vec4 color; varying vec2 texcoord0_px; varying vec4 color_px; void main() { // Pick the position or the annotation position vec2 pos = graph_position; // Transform the coordinates pos = vec2(graph

Why does OpenGL drawing fail when vertex attrib array zero is disabled?

给你一囗甜甜゛ 提交于 2020-01-22 17:48:08
问题 I was having extreme trouble getting a vertex shader of mine to run under OpenGL 3.3 core on an ATI driver: #version 150 uniform mat4 graph_matrix, view_matrix, proj_matrix; uniform bool align_origin; attribute vec2 graph_position; attribute vec2 screen_position; attribute vec2 texcoord0; attribute vec4 color; varying vec2 texcoord0_px; varying vec4 color_px; void main() { // Pick the position or the annotation position vec2 pos = graph_position; // Transform the coordinates pos = vec2(graph

OpenGL ES glFragColor depend on if condition on Fragment shader in iOS

本秂侑毒 提交于 2020-01-17 06:12:52
问题 I'm writing an app on iOS allows drawing free style (using finger) and drawing image on screen. I use OpenGL ES to implement. I have 2 functions, one is drawing free style, one is drawing texture --- Code drawing free style - (void)drawFreeStyle:(NSMutableArray *)pointArray { //Prepare vertex data ..... // Load data to the Vertex Buffer Object glBindBuffer(GL_ARRAY_BUFFER, vboId); glBufferData(GL_ARRAY_BUFFER, vertexCount*2*sizeof(GLfloat), vertexBuffer, GL_DYNAMIC_DRAW);

SDL OpenGL in C++, Texture Shader missing the texture

坚强是说给别人听的谎言 提交于 2020-01-16 00:42:38
问题 I am trying to create my first OpenGL Shader but are experiencing difficulties when trying to add a texture to a Cube object. Is anyone sharp eyed enough to spot the error? The code might have lots of errors, and I am grateful if anyone points them out, but I am most interested in why my rotating cube is gray and not colorful. (I have skipped all error handling to keep source code size low, sorry about that) * *EDIT Found out I missed some UV settings, still gray cube though ... #include