🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Latest OpenGL Activity
![Need to clip depth to inside of](https://uploads.gamedev.net/forums/monthly_2024_06/ce01c778cd2049f3a0d37d66adfec48a.tfury_2024-06-07_17-40-03.png)
Found a solution. What I had was mostly correct, but I needed to flush the ZBuffer, then re-draw my portal triangles to the depth buffer after drawing the contents of the portal.
void RENDER_StartPolyStencil(vertexStruct* v, int n)
{
glEnable(GL_STENCIL_TEST);
glDepthMask(GL_TRUE);
glStencilMask…
![Stencil buffer strange result](https://uploads.gamedev.net/forums/monthly_2024_05/993ded3de498425db9b0a13cb773b889.image.png)
Hi @_Silence_,
Okay, this is more complicated than I first imagined. I think that the main mistake I was making was thinking in terms of entire 3D objects when in reality I should be thinking in terms of primitives.
Might be worth restating what I would like to achieve and see whether this is possibl…
@Aressera I have managed to link everything but I have one problem. If I started a project as a C++ project but it depends on some .c files, how do I add them to the project folder? I opened the folder on my desktop and dragged and dropped the .c files where my main.cpp is but in the xcode app, it …
![Screen space ambient occlusion in Merc Tactics](https://uploads.gamedev.net/blogs/monthly_2024_05/large.a291bde303ff455c935e081c436abbfd.simpleSSAO.jpg)
I wanted to improve the graphic quality for Merc Tactics by adding a SSAO shader and I looked into several techniques. The best quality implementation of this is GTAO. There is also ASSAO, which is used in the Godot engine. Unfortunately, GTAO is a bit too heavy weight and I want Merc Tactics …
![Day/Night cycle inside my custom OpenGL engine](https://uploads.gamedev.net/blogs/monthly_2024_04/large.9ed5729bf5904182836716697f4d88f4.2024-04-21__day_night_cycle_full.jpg)
Finally implemented proper day/night cycle inside my custom OpenGL render.
Now the engine can vary sun position according to hour and day of the year, and also according to the latitude, with a good approximation.
![OpenGL Procedural Terrain - improved placement of snow](https://uploads.gamedev.net/blogs/monthly_2024_04/large.151d42ed4270469d93345951f0060b69.2024-04-17-12-08-45.jpg)
![Calculating Normals of a Cube](https://uploads.gamedev.net/forums/monthly_2024_02/19f60c60db46454597f80a020d6d4942.cube.png)
Thank you for the hint. I visualized the normal vectors and saw that they all had seemingly random orientations:
I printed out the calculated normals and visualized them by hand, confirming that they are actually all correct. I then changed my focus to the matter of actually sending this data to th…
snoken said:
I'm curious, what does the GetEdgePoly function return for you? Not seen a function name like this before
It returns the polygon index of the given half edge, or -1 if there is no ploy and we are on the boundary.
If we are at the boundary, u and v can be still computed. But there is no su…
![Applying rotation from animation](https://media.discordapp.net/attachments/368548735791267841/1187907881190817862/9550F0DB-9E29-4D62-A351-F686707B90B4.png?ex=6598986d&is=6586236d&hm=15dd9a99c72d16bce3e804851465ba23b6d94de486641efed6af4f178859b866&=)
Hi,
I am having a weird issue when rotating my character with animation. The issue is that a position in the world is being interpreted differently depending on the direction of the character. When I do not apply the animation rotation data to it, it seems correctly identify the position -519.0f, 0.…
The generic solution to your problem is commonly called “root motion" (https://docs.unrealengine.com/4.27/en-US/AnimatingObjects/SkeletalMeshAnimation/RootMotion/ , https://docs.unity3d.com/Manual/RootMotion.html).
I have no experience in implementing it myself, only used it in the various e…
![OpenGL procedural terrain - volumetric clouds](https://uploads.gamedev.net/blogs/monthly_2023_12/large.9dfae798424a49e4b74f6a613d0fa474.2023-12-13-16-26-11---terrain-%2B-volumetric-clouds.jpg)
Additional experiments with volumetric clouds, solved some glitches and managed to mix the clouds with the scene, using the depth of the scene to avoid to show clouds occluded by scene objects (like the terrain). For now I just used a simple 3D perlin noise for the clouds, in the future I plan to t…
![Handling animation translation](https://uploads.gamedev.net/forums/monthly_2023_12/6ee3bb62f6614f9e8b2575c802e31132.Screenshot-2023-12-12-at-23.36.03.png)
I have not worked much with animation data, and actually i have animated it all by myself.
But i think it is common to us a root bone which represents the ground. This root bone parents the hip / pelvis, which usually is the first bone in the character hierarchy.
When animating a walking cycle, the r…
![OpenGL - Displacement Mapping with Tessellation shaders - demo 02](https://uploads.gamedev.net/blogs/monthly_2023_12/large.55cde7b57561471ab996d2bd4c1915c3.2023-11-28__displacement_mapping_2.jpg)
Additional experiments with displacement mapping using OpenGL tessellation shaders. Textures from: Textures.com
snoken said:
When using quaternions, the skeleton looks fine except the z axis rotation. The arms go up instead of down. If I negate only Z, the arms come down as they should but they are not aligned with the torso, they are rotated back. Other than that, the skeleton looks fine and in the correct p…
![OpenGL - Displacement Mapping with Tessellation shaders](https://uploads.gamedev.net/blogs/monthly_2023_12/large.1f4e9d4c44da4c25a7690fbfc03633a4.2023-11-27__displacement_mapping.jpg)
More experiments with terrain rendering, trying to add finer detail using a displacement map, applied over a procedurally generated terrain.
Textures from: Textures.com and FreePBR.com
![Skeletal animation: Rotating left and right arm gives different results](https://preview.redd.it/ucynq2ofkj4c1.png?width=702&format=png&auto=webp&s=4723713ff2b13c8f62dcb7f3133edf73736e2816)
Thank you for helping me understand and providing an insightful response once again!
![Combining translation & rotations and per-frame rotations](https://preview.redd.it/r2j5x5myb54c1.png?width=1026&format=png&auto=webp&s=8cef8e3683e6673bb4934f790b5b47fab70f464a)
snoken said:
I am confused on how you are supposed to combine these matrices
The normal standard order for transformations is T.R.S. I'm unsure if BVH follows this however.
For BVH and the rotations order, it seems to be Y,X,Z: https://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
Simply trying it may give a faster answer than waiting for someone to answer the question.
Try to figure out what you see as the most likely correct solution, and build it in a small scale. If it works, you're done. If it fails you learned your idea was wrong, try to figure out what is wrong, correc…
I feel something is wrong specifically with RotationZ, when I apply this, the arms go all weird and the behaviour changes dramatically
![OpenGL rendering animation skeleton with cylinders](https://preview.redd.it/v6u12ud8oj3c1.png?width=1168&format=png&auto=webp&s=e3d8d8045e231516cbdda097c1b260e4995f0ac7)
You ignore rotations.
If you rotate the upper arm, you want to rotate the lower arm, hands etc. with it.
But currently you only propagate translation to child bones:
auto matrix = parentMatrix * Mat4::Translate(jointPos);
jointPos tells where the bone has its center of rotation, but you also need…
![OpenGL procedural terrain - triplanar texture mapping + normal mapping](https://uploads.gamedev.net/blogs/monthly_2023_11/large.a0a3411fc1834c90aeab2ba90fb5329c.2023-11-25-23-58-52.jpg)
Just a small demo of triplanar texture mapping + normal mapping in action over a procedurally generated surface.
To better show the effect, in this simple demo I used a brick texture over a very smooth terrain (generated using small values of "persistence").
Textures from:
. FreePBR.com
. Textures.com
C…
![Normals have weird splodges when TBN is applied](https://uploads.gamedev.net/forums/monthly_2023_11/445d089ded9947869d9bd1f7ddd5a1be.image.png)
Are you visualizing the normals correctly? It looks like the black is just negative values. You should do something like this to debug normals so that they are in [0,1] range:
gl_FragColor.rgb = n*0.5 + 0.5;
The colors are also much too saturated. If rendered with correct gamma, it should be lighter …
![OpenGL Procedural terrain - Improved texturing and normal mapping](https://uploads.gamedev.net/blogs/monthly_2023_11/large.7a910e98f446478a9717f774a1dede78.2023-11-24-19-31-13.jpg)
Thank you for the reply and giving an helpful and insightful explanation!
![World of Anork](https://uploads.gamedev.net/forums/monthly_2023_11/9fcf54dca3864390982105f9b281ddcd.1_web.jpg)
Hello,
World Of Anork is now released, in it's initial release:
@undefined Thanks! this fixed my issue! The camera now correctly looks down at it. The other issue I am having now is that my object seems clipped from the edges but it has nothing to do with the camera far plane since if I set it to a really high value, the issue persists
![Procedural terrain + adaptive exposure + BLOOM](https://uploads.gamedev.net/blogs/monthly_2023_11/large.232bf181f98b4c3a91e986004d037150.2021-12-20__improved_bloom_%2B_adaptive_exposure__walk.jpg)
Improved bloom + experiments with adaptive exposure.
Bloom is heavily inspired by the method described by Jorge Jimenez in his great slides here: http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare (starts from slide 144)
Hmm, looks like spinning in the wrong direction. First guess: My ‘direction = vec3(sin(angle), 0, -cos(angle))’ is wrong. You could do trial and error on flipping signs and swapping axis which gives 4 options to try:
direction = vec3(sin(angle), 0, -cos(angle));
direction = vec3(-sin(angle), 0, cos(…
![A small walk inside my procedurally generated terrain](https://uploads.gamedev.net/blogs/monthly_2023_10/large.ca68bfe876824b8d9b05e78a7227b6d7.small_walk_GL.jpg)
A small walk inside my procedurally generated terrain. Rendered in OpenGL.
The terrain was created using multiple layers of perlin noise and applying hydraulic erosion on it.
Grass and flowers are rendered using billboards and instancing.
![OpenGL procedural terrain - big map test](https://uploads.gamedev.net/blogs/monthly_2023_09/large.b8788c0ebab740beac30b9776c7beb98.2023-09-29-20-31-00__thumbnail.jpg)
![OpenGL Procedural terrain - improved water + in game audio](https://uploads.gamedev.net/blogs/monthly_2023_09/large.5fe05068db9d4f28873a02db236d71e9.2023-09-08-17-05-57__thumbnail_sp.jpg)
![Zengine - Game engine editor and Render-Scene Graph](/static/media/user/generic-user.png)
Following up from the previous blog post about the Java engine or “Zengine” that I'm developing with my friend. I was contemplating how to go about implementing an editor build or rather multiple build types for editing and for a game. After doing some brainstorming I've figured out how to implemen…
![Zengine - A Java game engine in LWJGL using Assimp, IMGUI, and more.](https://uploads.gamedev.net//static/media/user/generic-user.png)
So a couple of months ago, my friend and I both wanted to work on some sort of programming project together. We both work in software engineering but come from different backgrounds, I studied a BSc in Games Programming and he studied a BSc in Computer Science. Our idea was that we wanted to essent…
![Abandoning Vulkan](https://uploads.gamedev.net/blogs/monthly_2023_04/large.93206a02bcd749eeac1bcdb327297703.abvulkan.png)
I am a professional programmer, but I do not develop games for a living. In the past, I have brought you the fine small3d game development library, open source titles like Gloom, Avoid the Bug and Frog Remixed …
![A few basic changes in PyQt6 and PySide6 regarding shader-based OpenGL graphics](https://uploads.gamedev.net/blogs/monthly_2022_07/large.0cf0bb22391f4112a21da874703e5bbe.Logo-for-GameDevNet.png)
These changes are also true for PySide6.
1. OpenGL classes have been moved to a separate PyQt6.QtOpenGL namespace:
PyQt5:
from PyQt5.QtGui import (QOpenGLBuffer, QOpenGLShader, QOpenGLShaderProgram,
QOpenGLTexture)
PyQt6:
from PyQt6.QtOpenGL import (QOpenGLBuffer, QOpenGLShader, …
![DevBlog 26 - Finishing The Game!](https://uploads.gamedev.net/blogs/monthly_2022_05/large.c202447ac9634854bb151c00a321b8a8.sa_vid26_thumbnails.jpg)
It's over, I've finally completed my from scratch game project!
The final stretch has been far from glorious.
Rather than making features, it has been nonstop bug fixing.
To reach feature complete, I started just writing down non critical bugs rather than fixing them.
But after feature complete, I star…
![DevBlog 23 - Light Speed VFX, Player Slow Motion, and Asteroids](https://uploads.gamedev.net/blogs/monthly_2022_04/large.1881f6882aaf4ff3b8f0da10f31457e5.sa_vid23_thumbnail.jpg)
The Space Jump effect is pretty simple when looking at its individual components.
Previously I created a 3D star field for the environmental rendering.
I use the 3D locations of these stars in the effect.
When the effect starts, I start cranking up the light emitted for each star.
This is done by just …
![DevBlog 22 - Tighten Up The Graphics (Adding HDR, Bloom, Normal Maps, and more) [OpenGL 3.3]](https://uploads.gamedev.net/blogs/monthly_2022_04/large.8f7a6f8a353142e783251559f69bf6d1.sa_vid22_thumbnail.jpg)
I've refactored the rendering system in my engine.
The old way of rendering was complete in SDR.
In this update I created a separate off screen framebuffer that everything is rendered to first.
This offscreen framebuffer is a float framebuffer, and can store values outside of the normal [0,1] r…
![Vivid3D - New open source 3D engine.](https://uploads.gamedev.net/news/monthly_2022_01/large.1cff6e2f369e42c8b5320f49a0d5f231.pic1.png)
https://sourceforge.net/projects/vivid-3d/
Vivid is a modern C++ 3D engine using OpenGL4+.
It is written using Visual C++ 2022, and relies on several open source projects to achieve it's goal of making it easy and run to make modern games with it.
- GPU Accelerated Skeletal animations for actor…
![Ultra App Kit released - framework for desktop GUI applications](https://uploads.gamedev.net/news/monthly_2021_04/large.05000ce133af427aa6c3830d5f76e19f.Image1.jpg)
Built to power a new generation of game development tools, Ultra App Kit provides an easy-to-use C++ programming SDK for creating desktop GUI applications.
Unlike other alternatives like Dear ImGui, the Ultra App Kit GUI renders in retained mode rather than immediate mode, and is specifically …
![small3d Tutorial](https://uploads.gamedev.net/tutorials/monthly_2020_12/large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.large.722c4a1c07a24921bddd678938ca74e3.cover.png)
small3d is a small, cross-platform 3D game development library I have put together and have been maintaining over the past few years. This is a tutorial on creating a ball in Blender, and then writing a C++ program that loads it and moves it around on the screen, using small3d. Alternatively you ca…
![Shaders for Beginners (with examples in OpenGL and Defold)](https://uploads.gamedev.net/tutorials/monthly_2020_10/7b0732f5b20f478ab5aaaeae15a8725f.shaders_witchcrafter.gif)
I had many problems with understanding shaders, but after getting a grasp - it is so easy, convenient and powerful! I present to you my twisted version of understanding this, hoping it will help other aspiring devs ?
This is my slow path from a total noob to a less-noob-ish shader programmer ? It wi…
![Deep dive into OpenGL over DirectX layering](https://uploads.gamedev.net/news/monthly_2020_07/572c870f6566408f8e98013c50b531c5.d3d12-screenshot-CC.png)
Earlier this year, Collabora announced a new project with Microsoft: the implementation of OpenCL & OpenGL to DirectX translation layers. Here's the latest on this work, including the steps taken to improve the performance of the OpenGL-On-D3D12 driver.
![Introducing OpenCL and OpenGL on DirectX](https://uploads.gamedev.net/news/monthly_2020_03/f8e661245c924b6fb50eb42551aec84f.33049f936aa24ac1ace598e3947a1617.Collabora_OpenGL-DirectX_576.jpg)
Today, Collabora is excited to announce a partnership with Microsoft to build OpenCL and OpenGL mapping layers on DirectX, in order to bring OpenCL 1.2 and OpenGL 3.3 support to all Windows and DirectX 12 enabled devices. Support for OpenGL is realised through the Mesa3D project's Gallium layer.
![NeHe OpenGL Lessons now on GameDev.net Github](https://uploads.gamedev.net/monthly_2017_12/nehe.png.d4e9755d074f24927c4d928399ff7f6e.png)
We've just released all of the source code for the NeHe OpenGL lessons on our Github page at https://github.com/gamedev-net/nehe-opengl. code - 43 total platforms, configurations, and languages are included.
Now operated by GameDev.net, NeHe is located at http://nehe.gamedev.net where it has…
![OpenGL 4.6 Released](https://uploads.gamedev.net/monthly_2017_08/opengl_icon.jpg.c0ec64888e81ca592274c57c9e1d54e5.jpg)
The Khronos™ Group, an open consortium of leading hardware and software companies, announces from the SIGGRAPH 2017 Conference the immediate public availability of the OpenGL® 4.6 specification. OpenGL 4.6 integrates the functionality of numerous ARB and EXT extensions created by Khronos members…