tutorial | Geeks3D https://www.geeks3d.com Graphics Cards and GPUs News, Graphics Programming, Home of FurMark Tue, 11 Feb 2020 15:22:25 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://www.geeks3d.com/wp-content/uploads/2024/10/cropped-geeks3d-icon-20241010-01-32x32.jpg tutorial | Geeks3D https://www.geeks3d.com 32 32 How to Load SPIR-V Shaders in OpenGL https://www.geeks3d.com/20200211/how-to-load-spir-v-shaders-in-opengl/ https://www.geeks3d.com/20200211/how-to-load-spir-v-shaders-in-opengl/#comments Tue, 11 Feb 2020 15:22:25 +0000 http://www.geeks3d.com/?p=10004   Do you know that thanks to the GL_ARB_gl_spirv, it is possible to load SPIR-V shaders (the same shaders met in a Vulkan application) in OpenGL? Loading SPIR-V shaders in OpenGL is very easy. The only requirement is the support of OpenGL 4.6, which is usually the case on Windows with latest drivers from AMD, NVIDIA and Intel. On Linux, if I’m not wrong, proprietary … Continue reading How to Load SPIR-V Shaders in OpenGL »

The post How to Load SPIR-V Shaders in OpenGL first appeared on Geeks3D.]]>
https://www.geeks3d.com/20200211/how-to-load-spir-v-shaders-in-opengl/feed/ 1
Meet the Raspberry Pi GPIO Connector https://www.geeks3d.com/20150327/meet-the-raspberry-pi-gpio-connector/ https://www.geeks3d.com/20150327/meet-the-raspberry-pi-gpio-connector/#comments Fri, 27 Mar 2015 16:35:01 +0000 http://www.geeks3d.com/?p=9007 Article index: 1 – Overview of the GPIO Connector 2 – The 26-pin GPIO connector 3 – The 40-pin GPIO connector 4 – References 1 – Overview of the GPIO Connector The GPIO (or General Purpose Input Output) connector is a great feature of Raspberry Pi boards. Thanks to the GPIO, you can control real devices: the GPIO is the interface with the real world. … Continue reading Meet the Raspberry Pi GPIO Connector »

The post Meet the Raspberry Pi GPIO Connector first appeared on Geeks3D.]]>
https://www.geeks3d.com/20150327/meet-the-raspberry-pi-gpio-connector/feed/ 3
How to Rotate a Vertex by a Quaternion in GLSL (*Updated*) https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/ https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/#comments Mon, 01 Dec 2014 20:34:13 +0000 http://www.geeks3d.com/?p=8953 In a vertex shader, the rotation and position are usually encoded in the model matrix and we have something like this: vec4 worldPos = ModelMatrix * InPosition; Here is another method to transform the position of a vertex, using a quaternion to hold the rotation information. Quaternions are a fantastic mathematics tool discovered by Sir William Rowan Hamilton in 1843. We’re not going to review … Continue reading How to Rotate a Vertex by a Quaternion in GLSL (*Updated*) »

The post How to Rotate a Vertex by a Quaternion in GLSL (*Updated*) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/feed/ 4
GLSL 4×4 Matrix Fields https://www.geeks3d.com/20141114/glsl-4x4-matrix-mat4-fields/ https://www.geeks3d.com/20141114/glsl-4x4-matrix-mat4-fields/#comments Fri, 14 Nov 2014 16:18:21 +0000 http://www.geeks3d.com/?p=8941 Here is a short article about manipulating GLSL mat4 fields. In C, an OpenGL 4×4 matrix is a 16-float array: float c_matrix[16]; In GLSL the same matrix is: mat4 glsl_matrix; Let’s see how to map the C matrix to the GLSL one and vice-versa. Matrices in OpenGL are column-major. The c_matrix[] can be represented by: The first column is made up of entries 0, 1, … Continue reading GLSL 4×4 Matrix Fields »

The post GLSL 4×4 Matrix Fields first appeared on Geeks3D.]]>
https://www.geeks3d.com/20141114/glsl-4x4-matrix-mat4-fields/feed/ 3
Particle Billboarding with the Geometry Shader (GLSL) https://www.geeks3d.com/20140815/particle-billboarding-with-the-geometry-shader-glsl/ https://www.geeks3d.com/20140815/particle-billboarding-with-the-geometry-shader-glsl/#comments Fri, 15 Aug 2014 11:54:55 +0000 http://www.geeks3d.com/?p=8863 We learnt what the le billboarding is and how to implement it in the vertex shader, we can now look at another technique to achieve billboarding, particularly well suited for particle rendering. Usually, particles are points (a 3D position per particle) and the rendering of a textured particle requires a point to quad transformation. Point sprites are a nice solution for particle rendering. But, if … Continue reading Particle Billboarding with the Geometry Shader (GLSL) »

The post Particle Billboarding with the Geometry Shader (GLSL) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20140815/particle-billboarding-with-the-geometry-shader-glsl/feed/ 1
Simple Billboarding Vertex Shader (GLSL) https://www.geeks3d.com/20140807/billboarding-vertex-shader-glsl/ https://www.geeks3d.com/20140807/billboarding-vertex-shader-glsl/#comments Thu, 07 Aug 2014 13:52:16 +0000 http://www.geeks3d.com/?p=8861 Spherical billboarding Billboarding is a popular technique used in 3D graphics programming. Billboarding allows an object (usually a quad) to always face a given camera. Here are some common uses of billboarding: – particles – halo surrounding an object – trees rendering For the particular case of particles, the billboarding is a GPU built-in feature when point-sprites are used (a single point is transformed to … Continue reading Simple Billboarding Vertex Shader (GLSL) »

The post Simple Billboarding Vertex Shader (GLSL) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20140807/billboarding-vertex-shader-glsl/feed/ 1
GPU Buffers: Introduction to OpenGL 4.3 Shader Storage Buffers Objects https://www.geeks3d.com/20140704/tutorial-introduction-to-opengl-4-3-shader-storage-buffers-objects-ssbo-demo/ Fri, 04 Jul 2014 18:31:08 +0000 http://www.geeks3d.com/?p=8855 Article index: 1 – Introduction 2 – OpenGL Code 3 – Demo and References 1 – Introduction In this tutorial, we meet Uniform Buffer Objects (or UBO). To sum up a little bit, UBOs are read-only GPU-accessible memory zones for a GLSL shader. The size of an UBO is somewhat limited: 64KB for AMD and NVIDIA GPUs and 16KB for Intel ones. Limited size, read-only … Continue reading GPU Buffers: Introduction to OpenGL 4.3 Shader Storage Buffers Objects »

The post GPU Buffers: Introduction to OpenGL 4.3 Shader Storage Buffers Objects first appeared on Geeks3D.]]>
GPU Buffers: Introduction to OpenGL 3.1 Uniform Buffers Objects https://www.geeks3d.com/20140704/gpu-buffers-introduction-to-opengl-3-1-uniform-buffers-objects/ https://www.geeks3d.com/20140704/gpu-buffers-introduction-to-opengl-3-1-uniform-buffers-objects/#comments Fri, 04 Jul 2014 12:35:46 +0000 http://www.geeks3d.com/?p=8853 Article index: 1 – Introduction 2 – OpenGL Details 3 – Demo and References 1 – Introduction Uniform Buffer Objects (or UBO in short) have been introduced with OpenGL 3.1. The uniform buffers bible can be found here: GL_ARB_uniform_buffer_object. Uniform buffers are memory zones allocated in the video memory of the graphics card (they are GPU buffers) and allow to pass data from host application … Continue reading GPU Buffers: Introduction to OpenGL 3.1 Uniform Buffers Objects »

The post GPU Buffers: Introduction to OpenGL 3.1 Uniform Buffers Objects first appeared on Geeks3D.]]>
https://www.geeks3d.com/20140704/gpu-buffers-introduction-to-opengl-3-1-uniform-buffers-objects/feed/ 4
Simple Introduction to OpenGL 4 Shader Subroutines https://www.geeks3d.com/20140701/opengl-4-shader-subroutines-introduction-3d-programming-tutorial/ https://www.geeks3d.com/20140701/opengl-4-shader-subroutines-introduction-3d-programming-tutorial/#comments Tue, 01 Jul 2014 15:26:26 +0000 http://www.geeks3d.com/?p=8821 Article index: 1 – Overview 2 – Shader Subroutines Details 3 – References 1 – Overview Shader subroutines are a feature introduced in OpenGL 4.0 via this extension: GL_ARB_shader_subroutine: This extension adds support to shaders for “indirect subroutine calls”, where a single shader can include many subroutines and dynamically select through the API which subroutine is called from each call site. Switching subroutines dynamically in … Continue reading Simple Introduction to OpenGL 4 Shader Subroutines »

The post Simple Introduction to OpenGL 4 Shader Subroutines first appeared on Geeks3D.]]>
https://www.geeks3d.com/20140701/opengl-4-shader-subroutines-introduction-3d-programming-tutorial/feed/ 3
Mesh Exploder with Geometry Shaders https://www.geeks3d.com/20140625/mesh-exploder-with-geometry-shaders/ https://www.geeks3d.com/20140625/mesh-exploder-with-geometry-shaders/#comments Wed, 25 Jun 2014 10:00:56 +0000 http://www.geeks3d.com/?p=8846 Today, a simple but cool geometry shader (OpenGL 3.2) based demo: a mesh exploder. This demo is a simple use-case of geometry shaders where geometry shaders do not create (amplification) or kill vertices. They just deform input vertices. If you need some explanations about GS, you can read these articles: Simple Introduction to Geometry Shaders in GLSL (Part 1) Simple Introduction to Geometry Shaders in … Continue reading Mesh Exploder with Geometry Shaders »

The post Mesh Exploder with Geometry Shaders first appeared on Geeks3D.]]>
https://www.geeks3d.com/20140625/mesh-exploder-with-geometry-shaders/feed/ 2
Beginning with Pillow, the PIL Fork (Python Imaging Library) https://www.geeks3d.com/20131108/beginning-with-pillow-the-pil-fork-python-imaging-library-tutorial-programming/ Fri, 08 Nov 2013 19:47:52 +0000 http://www.geeks3d.com/?p=8693 Article index: 1 – Pillow Installation 2 – Pillow Version 3 – Image Loading and Saving 4 – Reading the pixels 5 – Image Processing 6 – Image Processing Operations 7 – Adding a watermark PIL, the Python Imaging Library, is a powerful tool for playing and tweaking images. But PIL is no longer an active project. That’s why the Python community (mainly Alex Clark) … Continue reading Beginning with Pillow, the PIL Fork (Python Imaging Library) »

The post Beginning with Pillow, the PIL Fork (Python Imaging Library) first appeared on Geeks3D.]]>
Mac OS X and OpenGL Virtual Screens https://www.geeks3d.com/20131105/mac-os-x-and-opengl-virtual-screens/ https://www.geeks3d.com/20131105/mac-os-x-and-opengl-virtual-screens/#comments Tue, 05 Nov 2013 15:38:16 +0000 http://www.geeks3d.com/?p=8688 Virtual screens are a very nice feature of Mac OS X. I’m sure that GPU overclockers under Windows would love them. Under Windows if you have two graphics cards, there is only one way to use both GPUs with OpenGL or Direct3D: NVIDIA SLI or AMD CrossFire. What’s more, SLI and CrossFire require nearly identical graphics cards. You can’t do SLI with a GTX 780 … Continue reading Mac OS X and OpenGL Virtual Screens »

The post Mac OS X and OpenGL Virtual Screens first appeared on Geeks3D.]]>
https://www.geeks3d.com/20131105/mac-os-x-and-opengl-virtual-screens/feed/ 3
OpenGL 4.2 Atomic Counters: Rasterization Pattern, Helper for Rendering Optimization (Windows, Linux) https://www.geeks3d.com/20131031/opengl-4-2-atomic-counters-rasterization-pattern-helper-for-rendering-optimization-windows-linux/ https://www.geeks3d.com/20131031/opengl-4-2-atomic-counters-rasterization-pattern-helper-for-rendering-optimization-windows-linux/#comments Thu, 31 Oct 2013 18:09:35 +0000 http://www.geeks3d.com/?p=8642 Article index: 1 – Rasterization pattern 2 – Number of Processed Vertices 3 – Number of Processed Fragments 4 – Bugs… 5 – References This demo is an update of the first atomic counters demo I published last year. No big changes except this new demo is for GLSL Hacker and then is available for Windows and Linux and maybe in a decade for OS … Continue reading OpenGL 4.2 Atomic Counters: Rasterization Pattern, Helper for Rendering Optimization (Windows, Linux) »

The post OpenGL 4.2 Atomic Counters: Rasterization Pattern, Helper for Rendering Optimization (Windows, Linux) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20131031/opengl-4-2-atomic-counters-rasterization-pattern-helper-for-rendering-optimization-windows-linux/feed/ 2
How to Create a Lua Module https://www.geeks3d.com/20130906/how-to-create-a-lua-module/ Fri, 06 Sep 2013 10:02:14 +0000 http://www.geeks3d.com/?p=8638 A module in the Lua programming language is a piece of code that contains functions and variables: it’s an user library. It’s a powerful way to split your code in several files. A module is loaded using the Lua require keyword. The module is coded in a file with the .lua extension and this file must be present in Lua package search path (package.path). A … Continue reading How to Create a Lua Module »

The post How to Create a Lua Module first appeared on Geeks3D.]]>
Exploring GLSL – Normal Visualizer with Geometry Shaders (Shader Library) https://www.geeks3d.com/20130905/exploring-glsl-normal-visualizer-with-geometry-shaders-shader-library/ https://www.geeks3d.com/20130905/exploring-glsl-normal-visualizer-with-geometry-shaders-shader-library/#comments Thu, 05 Sep 2013 13:19:30 +0000 http://www.geeks3d.com/?p=8637 Article index: 1 – Vertex Normal Visualizer 2 – Face Normal Visualizer 3 – References Hi dear readers, I’m back! Three weeks without new posts… Lot of things to do combined with many sunny days == no post on Geeks3D 😉 Today, we’re going to see a simple but really useful application of geometry shaders: a normal visualizer. I already talked about GLSL geometry shaders … Continue reading Exploring GLSL – Normal Visualizer with Geometry Shaders (Shader Library) »

The post Exploring GLSL – Normal Visualizer with Geometry Shaders (Shader Library) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20130905/exploring-glsl-normal-visualizer-with-geometry-shaders-shader-library/feed/ 3
(Tested) Raspberry Pi Model B Board: Unboxing and First Boot https://www.geeks3d.com/20130705/raspberry-pi-model-b-board-unboxing-and-first-boot-raspbian-linux-test/ https://www.geeks3d.com/20130705/raspberry-pi-model-b-board-unboxing-and-first-boot-raspbian-linux-test/#comments Fri, 05 Jul 2013 15:04:15 +0000 http://www.geeks3d.com/?p=8606 Article index: 1 – The Raspberry Pi Model B Board 2 – The Raspberry Pi Model B Power Supply 3 – Preparation of the Raspberry Pi Operating System 4 – Raspberry Pi: First Boot Few days ago I ordered a Raspberry Pi board and I received it this morning. Why a Raspberry Pi board? Because this tiny computer includes an OpenGL ES capable GPU and … Continue reading (Tested) Raspberry Pi Model B Board: Unboxing and First Boot »

The post (Tested) Raspberry Pi Model B Board: Unboxing and First Boot first appeared on Geeks3D.]]>
https://www.geeks3d.com/20130705/raspberry-pi-model-b-board-unboxing-and-first-boot-raspbian-linux-test/feed/ 3
Circle, Disc and Fake Sphere in GLSL (Shader Library) https://www.geeks3d.com/20130705/shader-library-circle-disc-fake-sphere-in-glsl-opengl-glslhacker/ https://www.geeks3d.com/20130705/shader-library-circle-disc-fake-sphere-in-glsl-opengl-glslhacker/#comments Fri, 05 Jul 2013 09:51:38 +0000 http://www.geeks3d.com/?p=8605 Article index: 1 – Simple Circle in GLSL 2 – A better Circle in GLSL 3 – A Disc in GLSL 4 – A Fake Sphere in GLSL Today some GLSL code to draw a circle, a disc and a fake sphere. And to make circles and discs more appealing, the background pixels take their RGB values from this geeky Captain America woman. The demos … Continue reading Circle, Disc and Fake Sphere in GLSL (Shader Library) »

The post Circle, Disc and Fake Sphere in GLSL (Shader Library) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20130705/shader-library-circle-disc-fake-sphere-in-glsl-opengl-glslhacker/feed/ 2
Building Worlds With Distance Functions in GLSL (Raymarching) https://www.geeks3d.com/20130524/building-worlds-with-distance-functions-in-glsl-raymarching-glslhacker-tutorial-opengl/ https://www.geeks3d.com/20130524/building-worlds-with-distance-functions-in-glsl-raymarching-glslhacker-tutorial-opengl/#comments Fri, 24 May 2013 13:19:37 +0000 http://www.geeks3d.com/?p=8148 Article index: 1 – Raymarching, Distance functions 2 – GLSL framework for Raymarching 3 – Raymarching: Floor + Sphere 4 – Raymarching: Floor + Torus 5 – Raymarching: Floor + Rounded Box 6 – Raymarching: Floor + Union of Rounded Box and Sphere 7 – Raymarching: Floor + Rounded Box minus Sphere 8 – Raymarching: Primitive Blending 9 – Raymarching: Primitive Repetition 1 – Raymarching, … Continue reading Building Worlds With Distance Functions in GLSL (Raymarching) »

The post Building Worlds With Distance Functions in GLSL (Raymarching) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20130524/building-worlds-with-distance-functions-in-glsl-raymarching-glslhacker-tutorial-opengl/feed/ 4
OpenGL Interpolation Qualifiers (GLSL) https://www.geeks3d.com/20130514/opengl-interpolation-qualifiers-glsl-tutorial/ https://www.geeks3d.com/20130514/opengl-interpolation-qualifiers-glsl-tutorial/#comments Tue, 14 May 2013 15:39:54 +0000 http://www.geeks3d.com/?p=8557 OpenGL 3 introduced three interpolation qualifiers that are at our disposal in the vertex and fragment shaders. These interpolation qualifiers allow to specify the way a vertex shader output is interpolated across a primitive. The OpenGL spec/wiki says: flat: the value is not interpolated. The value given to the fragment shader is the value from the Provoking Vertex for that primitive. smooth: performs a perspective … Continue reading OpenGL Interpolation Qualifiers (GLSL) »

The post OpenGL Interpolation Qualifiers (GLSL) first appeared on Geeks3D.]]>
https://www.geeks3d.com/20130514/opengl-interpolation-qualifiers-glsl-tutorial/feed/ 5
Know Your OpenGL Tessellation Spacing Modes https://www.geeks3d.com/20130128/know-your-opengl-tessellation-spacing-modes/ https://www.geeks3d.com/20130128/know-your-opengl-tessellation-spacing-modes/#comments Mon, 28 Jan 2013 15:36:19 +0000 http://www.geeks3d.com/?p=8456 In OpenGL 4 (as well as in Direct3D 11), the tessellation levels are specified with floating points numbers. For example, if the tessellation level is 3.0 (for both outer and inner levels), a edge will be divided in three parts (or three segments). But in how many segments the same edge will be subdivided if the tessellation level is 3.25? And 3.75? The answer is … Continue reading Know Your OpenGL Tessellation Spacing Modes »

The post Know Your OpenGL Tessellation Spacing Modes first appeared on Geeks3D.]]>
https://www.geeks3d.com/20130128/know-your-opengl-tessellation-spacing-modes/feed/ 1