Click here to Skip to main content
15,892,161 members
Everything / GLSL

GLSL

GLSL

Great Reads

by Carlos Jiménez de Parga
A reusable Visual C++ framework for real-time volumetric cloud rendering, animation and morphing
by Gary.Miller.WPF
In this article, I describe how I implemented a 3D subdivision surface modeling application in JavaScript and WebGL.
by Peter Occil
Explains graphics filters for the HTML 3D canvas, and how they work in my public domain HTML 3D library.
by EgorYusov
This article introduces the problem of resource state management and synchronization in modern graphics APIs such as Direct3D12 and Vulkan and describes a solution offered by Diligent Engine.

Latest Articles

by Carlos Jiménez de Parga
A reusable Visual C++ framework for real-time volumetric cloud rendering, animation and morphing
by Gary.Miller.WPF
In this article, I describe how I implemented a 3D subdivision surface modeling application in JavaScript and WebGL.
by EgorYusov
This article introduces the problem of resource state management and synchronization in modern graphics APIs such as Direct3D12 and Vulkan and describes a solution offered by Diligent Engine.
by Peter Occil
Explains graphics filters for the HTML 3D canvas, and how they work in my public domain HTML 3D library.

All Articles

Sort by Score

GLSL 

3 Apr 2022 by Carlos Jiménez de Parga
A reusable Visual C++ framework for real-time volumetric cloud rendering, animation and morphing
29 Jun 2020 by Gary.Miller.WPF
In this article, I describe how I implemented a 3D subdivision surface modeling application in JavaScript and WebGL.
20 May 2015 by Peter Occil
Explains graphics filters for the HTML 3D canvas, and how they work in my public domain HTML 3D library.
26 Jan 2012 by stigersh
I want to write Flat, Gouraud and Phong shadings in the same application. I think it's a problem writing them in the same shader with "if" statements, because some of the variables are supposed to be uniform in flat while supposed to be varying in Phong.If I write 3 different shaders, does...
27 Jan 2012 by CDP1802
Starting with those three classic shaders is a good idea. I would suggest that you use three separate shaders and do not tryto integrate them into one. Shaders are like short functions which are going to be loaded into the GPU for execution. The GPU has only limited memory to store the shaders....
12 Nov 2012 by BobJanova
I can't see where you're adding any geometry to your scene. A shader is typically applied to geometry, even if it's a pixel shader. Try drawing a quad in front of the camera and attaching the pixel shader to that.
21 Jun 2013 by amsainju
Hello, Is it possible to send the gl_FragColor.a value for fragment shader dynamically on the runtime. say for example, user input the alpha value in a text box and the value will be assigned to the gl_FragColor.a variable; my fragment shader code isvoid main(){ gl_FragColor =...
21 Jun 2013 by Santhosh G_
Please add a uniform parameter in your glsl shader program.Then set value to this parameter using glGetUniformLocation[To get the parameter id to cpp program] and glUniform [To change the value of parameter]// This value can be changed before rendering a frame.// Whenever you need to...
22 Dec 2018 by EgorYusov
This article introduces the problem of resource state management and synchronization in modern graphics APIs such as Direct3D12 and Vulkan and describes a solution offered by Diligent Engine.
27 Jan 2012 by stigersh
Hi,I want to send uniforms or attributes which are structs which are defined by me, or arrays of "my" structs to the shaders. They should be recognized by the application (C++) and the shader (GLSL). Is it possible? Where should I define them? Thanks
29 Jan 2012 by Santhosh G_
// Inside fragment/vertex shaderstruct TheStruct // user defined structure.{ vec3 first; vec4 second; mat4x3 third;}; uniform TheStruct aUniformOfArrayType; // instance of uniform user-defined parameter.In application(C++) code, the name " aUniformOfArrayType" does not...
1 Feb 2012 by stigersh
Hi,I'm writing a Phong shader with multiple lights. I send a uniform array to both vertex and fragment shaders. Let's say one of the arrays isuniform vec3 lights[8];then I loop over it in the program, for example:vec3 color=0;for (i=0;i
16 Feb 2012 by stigersh
Hi,I've made Phong shaders and they worked well on 3 first objects. When I try to add one more, the first 3 appear messed up completely. When I try to load another one, the program crashes with access violation on the command: glDrawArrays( GL_TRIANGLES, 0, pvertices->size());Ideas anyone?
12 Nov 2012 by NKlinkachev
Background: I've started playing around with raytracing and thought it'll be a good idea to write the raytracer using GLSL shaders as it'll optimize the performance a lot.Problem: I've written (more of a assemble from parts of code on the internet) a simple program to test GLSL shaders but...
18 Nov 2012 by Liam S. Crouch
Hi.Lets say i have an array of floats:float[] points = {1.0, 0.0, 0.5,1.0, 1.0,1.0, 1.0, 1.0};This is one point on ex a triangle, where the first 3 floats are coordinates, the 2 next texture coordinates, and the last 3 normal coordinates.How do i fast draw this in OpenGL...
18 Nov 2012 by lukeer
I've never done anything in OpenGL. But referring to MSDN[^], I suggestfloat[] points = { 1.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F, 1.0F, 1.0F};glNormal3f(points[0], points[1], points[2]);glTexCoord2f(points[3], points[4]);glVertex3f(points[5], points[6], points[7]);points...
26 Jun 2013 by amsainju
Hello Everyone, void mainRender(){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderSTLs(); glEnable(GL_ALPHA_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); renderPoints();}I need to achieve mutual...
27 Jun 2013 by Balaji_mcr
My application simply loads an image as a Texture & rotate it in Z-axis.This is my code.----Beginning of code----Reference Source code.http://www.opengl.org/sdk/docs/tutor...SL_Texture.zipmain.cppCode :virtual void...
27 Jun 2013 by Santhosh G_
void mainRender(){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderSTLs(); glEnable(GL_ALPHA_TEST); glEnable(GL_BLEND); if( bPointThroughSTL ) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else { // Here alpha from...
27 Jun 2013 by amsainju
I found out that I had some mistake in calculating position in vertex shader. It works fine accroding to Santhosh G_ method.
30 Jun 2013 by Balaji_mcr
Hi the solution is very simple. By default freeglut is rendering at 60 fps & it is constantly calling the OnIdle() number of times.(OnIdle() is called when Message Queue is Empty).That's why the application takes more CPU usage. so if u don't want to use this Idle function we can remove that...
12 Mar 2014 by HuggableAlien
Hi there, I am trying to implement shadow mapping in LWJGL, but have run into a problem, and am now stuck. I have done depth-mapping, render to texture etc. but I am stuck at the most vital part, using said shadow map, my problem is, I need to find out where the fragment I am shading is located...
30 Oct 2018 by simarmannsingh
I have to display text. For that, I am trying to follow this[1] tutorial to display the text. As mentioned in the tutorial, I've linked the libraries and there seem to be no error in linking of the library. So here is the structure of my application. The entry point of my project is...
30 Oct 2018 by Seal2002
Just one point I see in your code, that is your projection in the FontRenderer is bigger than your viewport. I also suggest you should init VAO, VBO inside the FontRenderer instead via the variable. I also use the freetype for render the text and it is fine. I will send you the link demo if you...
6 Apr 2023 by KarstenK
This clearly looks that you missed to draw one part. Most common reasons are: a) you draw it on the wrong position or b) ferget to draw it c) draw with clear color float vertices[] = { //top-north-east 0.0f, -1.0f, 0.0f, // is...
23 Jul 2014 by martin_bisson
How to use OpenCL with OpenGL to implement algorithms on GPU.
21 Sep 2011 by Santhosh G_
Implementation of different interpolations[Bi-Linear and Bi-Cubic] with OpenGL.
27 Jan 2013 by Khaldoon Ghanem
This article describes how to visualize complex-valued functions of a single complex variable using the domain coloring method on GPU.
28 Apr 2014 by Bartlomiej Filipek
Review of a very interesting book about Modern OpenGL Application Development.
17 Apr 2023 by Chillzy
So I went onto a different forum and I asked this question, and somebody helped me solve it. It turns out that the coordinates for the octahedron were wrong. The problematic ones were top-north-east and bottom-south-east. I'll give a list of the...
30 Oct 2018 by simarmannsingh
Thanks @Seal2002. I really appreciate it. It is working fine now. :)
17 Apr 2023 by Chillzy
I'm working on a program where I need to make spheres. My chosen method is to create an octahedron https://i.stack.imgur.com/xHpcm.png[^] and through tessellation shaders, subdividing it and then normalizing the coordinates into an octa sphere...