Hi everyone I am trying to render an object to the screen, I have gotten the pipeline to work succesfully, but I can’t seem to draw anything using glDrawElements or glDrawArrays. I tested the pipeline by calling glClearColor(1.0f,0.0f,0.0f,1.0f) in the renderer.Draw() function and I got a red background. I think it either has to do ..

#### Category : vertex-shader

I’m making a model viewer in C++ and am trying to visualise my vector norms on my model using a vertex, fragment and geometry shader, however its only displaying a few lines on the screen instead of one per vector, here is my shader code: //Create vertex shader for visNorm const GLchar* vertexShaderVN = "#version ..

My object is a smooth barrel, with only the color and the original normals it looks like this: barrel with the original normals When I try to add the normal detail via a texture the smooth normals get overwritten like so: barrel with the overwritten normals Is there a better way to merge the new ..

I have a ping pong game and I want to know how to send scores of players to the vertex shader and show it on the top of my window and it can be changed by every score that every player earn I wrote it in CPU side by bitmap function but I don’t know ..

i’ve started studying C++/OpenGL for a year, i’ve stumbled on a vague bug with GLSL language. i wonder if someone had got it similarly. the bug is produced only when i omitted the layout(location = ?) in the vertex shade and i’ve to specify the index of the generic vertex attribute for both glVertexAttribPointer and ..

I am trying to understand the code for sierpinski gasket. This is some rough code: headers and constants #include "Angel.h" const int NumPoints = 5000; init() void init(void) { vec2 points[NumPoints]; // Specifiy the vertices for a triangle vec2 vertices[3] = { vec2(-1.0, -1.0), vec2(0.0, 1.0), vec2(1.0, -1.0) }; // Select an arbitrary initial point ..

I am struggling to figure out how to calculate the normals for the sin wave on my sphere in the vertex shader. The function to generate the wave is input.position.xyz += input.normal * sin(input.position.x * wavelengthS + time / speedS) * amplitudeS; I’m pretty sure I understand how to do it along 1 axis but ..

this is my CAMERA class which makes viewMat uniform var in vertexshader. struct CAMERA { glm::vec3 EYE{ 0.0f,0.0f,150.0f }; glm::vec3 AT{ 0.0f,0.0f,0.0f }; glm::vec3 UP{ 0.0f,1.0f,0.0f }; glm::vec3 Dir() { return glm::normalize(this->EYE – this->AT); } glm::vec3 Right() { return glm::normalize(glm::cross(this->UP, this->Dir())); } glm::vec3 Up() { return glm::normalize(glm::cross(this->Dir(), this->Right())); } glm::mat4 view_M() { glm::vec3 cameraDirection = ..

## Recent Comments