I have three questions here:
- Is the Qt/3D API implemented by GLSL code?
- Is GLSL code compiled and linked as normal c/c++ code, and can it run on CPU (not GPU)?
- Why GLSL is better at rendering than normal c/c++?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You seem to have a fundamental misunderstanding of what GLSL is. It’s not a programming language for graphics. It is a shader language.
In the OpenGL rendering pipeline, there are certain stages in the rendering of an object that are designed to be implemented by a program. These stages are called “shader stages”. A shader is a program, written in GLSL (for OpenGL at least) which is executed at one of these shader stages.
GLSL is used as part of the process of rendering. GLSL defines how things get rendered, not what gets rendered.
Therefore:
Not in the way you mean. Some of the rendering pipeline for the drawing functions may be. But it may not. It’s not really relevant to you, since you’re using it from the outside.
No, per above. Shaders affect rendering, and rendering takes place on the GPU. GLSL is the shading language for OpenGL, therefore GLSL code is executed on the GPU.
It’s not better or worse; you cannot use one for the other. You cannot just throw random C-code at a GPU as part of the rendering pipeline. And you cannot compile GLSL for CPUs.
GLSL is what we call a domain specific language. It is a language designed to facilitate a particular purpose. It has language constructs that most languages simply don’t have. It knows what a “texture” is. It has the concept of values which are invariant across multiple executions of a shader within a single rendering call (uniforms). It has many other concepts that are unique to the problem of hardware-based shaders and rendering.
Not only can you not throw C or C++ at a GPU, you wouldn’t want to. Not for shaders.