Similar Content

I'm trying to get some legacy OpenGL code to run with a shader pipeline,
The legacy code uses glVertexPointer(), glColorPointer(), glNormalPointer() and glTexCoordPointer() to supply the vertex information.
I know that it should be using setVertexAttribPointer() etc to clearly define the layout but that is not an option right now since the legacy code can't be modified to that extent.
I've got a version 330 vertex shader to somewhat work:
#version 330
uniform mat4 osg_ModelViewProjectionMatrix;
uniform mat4 osg_ModelViewMatrix;
layout(location = 0) in vec4 Vertex;
layout(location = 2) in vec4 Normal; // Velocity
layout(location = 3) in vec3 TexCoord; // TODO: is this the right layout location?
out VertexData {
vec4 color;
vec3 velocity;
float size;
} VertexOut;
void main(void)
{
vec4 p0 = Vertex;
vec4 p1 = Vertex + vec4(Normal.x, Normal.y, Normal.z, 0.0f);
vec3 velocity = (osg_ModelViewProjectionMatrix * p1 - osg_ModelViewProjectionMatrix * p0).xyz;
VertexOut.velocity = velocity;
VertexOut.size = TexCoord.y;
gl_Position = osg_ModelViewMatrix * Vertex;
}
What works is the Vertex and Normal information that the legacy C++ OpenGL code seem to provide in layout location 0 and 2. This is fine.
What I'm not getting to work is the TexCoord information that is supplied by a glTexCoordPointer() call in C++.
Question:
What layout location is the old standard pipeline using for glTexCoordPointer()? Or is this undefined?

Side note: I'm trying to get an OpenSceneGraph 3.4.0 particle system to use custom vertex, geometry and fragment shaders for rendering the particles.

Hi i am new to this forum i wanted to ask for help from all of you i want to generate real time terrain using a 32 bit heightmap i am good at c++ and have started learning Opengl as i am very interested in making landscapes in opengl i have looked around the internet for help about this topic but i am not getting the hang of the concepts and what they are doing can some here suggests me some good resources for making terrain engine please for example like tutorials,books etc so that i can understand the whole concept of terrain generation.

Hi everyone, I've shared my 2D Game Engine source code. It's the result of 4 years working on it (and I still continue improving features ) and I want to share with the community. You can see some videos on youtube and some demo gifs on my twitter account.
This Engine has been developed as End-of-Degree Project and it is coded in Javascript, WebGL and GLSL. The engine is written from scratch.
This is not a professional engine but it's for learning purposes, so anyone can review the code an learn basis about graphics, physics or game engine architecture. Source code on this GitHub repository.
I'm available for a good conversation about Game Engine / Graphics Programming

I would like to introduce the first version of my physically based camera rendering library, written in C++, called PhysiCam.
Physicam is an open source OpenGL C++ library, which provides physically based camera rendering and parameters. It is based on OpenGL and designed to be used as either static library or dynamic library and can be integrated in existing applications.

The following features are implemented:
Physically based sensor and focal length calculation
Autoexposure
Manual exposure
Lense distortion
Bloom (influenced by ISO, Shutter Speed, Sensor type etc.)
Bokeh (influenced by Aperture, Sensor type and focal length)
Tonemapping
You can find the repository at https://github.com/0x2A/physicam