Multiple vertex color sets in OpenGL

Started by
31 comments, last by convert 1 year, 4 months ago

@taby I don´t want to use any external APIs. In the new versions of OpenGL you have to do a lot of things old OpenGL have done for you yourself or use more external APIs.

Advertisement

There is a card game prototype at:

https://github.com/sjhalayka/blind_poker/tree/master/blind%20poker/bp

Specifically, see matrix_utils.h and matrix_utils.mm. These contain the functionality that GLM provides, but without using GLM. So, you can see, the code is not very difficult to implement, nor does it take a super long code. If you get that working, I can help you further. The only other thing to learn are the various shader types, really — that is: do not use the OpenGL ES 2 shaders from this prototype in your OpenGL 4 code. I'll teach you that when you have your camera working.

taby said:

You really should use OpenGL 4. With the help of GLM, it's not much harder than OpenGL 1. There you can upload any kind of data you want into the shader, including data representing multiple colours. It is so much better.

Have also a strong aversion against shaders, looks like python or some other strange programming language, but not C/C++. Also the GPU is predestinated for al that matrix operations, but the new OpenGL forces you to do all that stuf in software no meter if yourself or using external APIs like GLM.

Where‘s your sense of adventure?

taby said:

Where‘s your sense of adventure?

Don´t have such sence. Also don´t get it wrong, I am really grateful for the help you have proposed.

We will be waiting nonetheless. Let us know when you want to upgrade. ?

Image with shadow map, OpenGL 4

convert said:

Have also a strong aversion against shaders, looks like python or some other strange programming language, but not C/C++.

It is surprising you'd say that, I've always thought that shader code looks like C.

This is what GLSL looks like :

#version 150
 
layout(triangles) in;
layout (triangle_strip, max_vertices=3) out;
 
in VertexData {
    vec2 texCoord;
    vec3 normal;
} VertexIn[3];
 
out VertexData {
    vec2 texCoord;
    vec3 normal;
} VertexOut;
 
 void main()
{
  for(int i = 0; i < gl_in.length(); i++)
  {
     // copy attributes
    gl_Position = gl_in[i].gl_Position;
    VertexOut.normal = VertexIn[i].normal;
    VertexOut.texCoord = VertexIn[i].texCoord;
 
    // done with the vertex
    EmitVertex();
  }
}

This is what Python looks like :

import requests
import re
 
url = input("Enter the URL: ")
 
html = requests.get(url).text
 
links = re.findall('"(https?://.*?)"', html)
 
for link in links:
    print(link)

@Warp9 At least for me python is the most strange programming language which is comonly used. At least that GLSL is not looking like C/C++ for me.

@convert Both GLSL and HLSL are C based langauges. They just extended the keywords and types to accomodate for SIMD processing.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

This topic is closed to new replies.

Advertisement