r/GraphicsProgramming • • Feb 26 '25

Question Does anyone know why i get undefined reference errors regarding glad - building with cmake?

0 Upvotes

So i am trying to build my file and i get undefined reference errors when actually trying to build my project. This is weird because when im doing literally the same thing in C, it works.

EDIT: By adding C to the langauges im using --- project(main C CXX) --- i fixed the issue.

CMakeLists.txt:

cmake_minimum_required(VERSION 3.10)

project(main CXX)

add_executable(main "main.cpp" "glad.c")

find_package(glfw3 REQUIRED)
target_link_libraries(main glfw)

set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
target_link_libraries(main OpenGL::GL)

and this is my main.cpp file:

#include <glad/glad.h>
#include <GLFW/glfw3.h>

int main(void)
{
    GLFWwindow* window;

    /* Initialize the library */
    if (!glfwInit())
        return -1;

    /* Create a windowed mode window and its OpenGL context */
    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        return -1;
    }

    /* Make the window's context current */
    glfwMakeContextCurrent(window);
    gladLoadGL();

    /* Loop until the user closes the window */
    while (!glfwWindowShouldClose(window))
    {
        /* Render here */
        glClear(GL_COLOR_BUFFER_BIT);

        /* Swap front and back buffers */
        glfwSwapBuffers(window);

        /* Poll for and process events */
        glfwPollEvents();
    }

    glfwTerminate();
    return 0;
}

r/GraphicsProgramming • • Mar 13 '22

Question What is a public domain graphics backend?

0 Upvotes

What is a public domain graphics backend?

More particularly, I was reading the demos for Nuklear:

https://github.com/Immediate-Mode-UI/Nuklear/tree/master/demo

and they give several options. I wonder if some of those are public domain.


r/GraphicsProgramming • • Sep 01 '21

Working on a software renderer, confused as to why my explicit light sampling isn't working

0 Upvotes

I'm working on a software renderer in Java.

I have implemented a naive path tracer, and am in the process of implementing a smarter path tracer (rendering/SmartPathTracerRenderer.java), including russian roulette path termination, bsdf sampling for new ray direction, and explicit light sampling.

I think that I am calculating the pdf of my light sampling incorrectly, but I'm not really sure what I'm doing wrong. The resulting images seem to be too bright, and suggesting that the cos(theta)/pdf value is greater than one. I'm certain that I'm calculating cos(theta) correctly, so I think it's probably my pdf

github repository

Advice is welcome. Also, see my sample images


r/GraphicsProgramming • • Jul 26 '20

With all this talk of directed graphs.

0 Upvotes

I spent a couple of hours banging together a simple directed graph template in C++.

It's pretty bare bones and probably quite buggy & inefficient but it has functions for the following:

- Construction (performs topological sort)

- Search for parent and child nodes

- Search for sibling nodes (core component of the static analyser mentioned in the resource tagging thread)

- Schedule potential jobs given a set of completed tasks.

It was written in one sitting so there may be some nasties but the basic tests pass and there are no warnings. I aim to give it a cleanup pass, readme and license later. It will be MIT.

https://github.com/spectral3d/simple_dag


r/GraphicsProgramming • • Apr 19 '24

Question College degree requirement?

0 Upvotes

I've been looking around if graphic programmer needs a degree but getting mixed answers.

It seems like you don't need degree for the actual job itself but to actually get the job interview in the first place you need a degree for substantially better response rate?

Is this accurate assessment?


r/GraphicsProgramming • • Aug 10 '18

Siggraph 2018 tickets. What am I doing wrong ?

0 Upvotes

Ok I am trying to buy tickets for Siggraph in Tokyo 2018:

https://sa2018.siggraph.org/en/registration-travel/registration-categories-and-fees

That is the link.

So what am I doing wrong ? Why can't I see a buy tickets link ?


r/GraphicsProgramming • • Jan 18 '23

I want volumetric 3D graphics, ray-tracing, and reliable physics. Are voxels the way to go?

0 Upvotes

Apparently they are memory intensive, but I see there are methods of getting around this. What are they? do they require mathematical expertise? I don't mind if the graphics look low-res and pixely btw (well, I might use smooth voxels, idk) I just want something that looks better than minecraft and that can support an open world (though perhaps, not so infinite as minecraft feels like).


r/GraphicsProgramming • • Nov 16 '17

Question [X-post /r/Unity3D] In the Unity game engine, how do I get the exact values of the near and far planes in clip space, both in a shader and in C#?

Thumbnail
reddit.com
0 Upvotes

r/GraphicsProgramming • • Oct 24 '21

Question Looking for software / algorithm / program to generate Viking patterns inside a shape

0 Upvotes

As the title says. I was searching for something that can achieve what's described above, but fell short. Stumbled on couple of sites that can generate the patterns, but none that would fill a shape with them. Any advice or direction would be most welcome.


r/GraphicsProgramming • • Oct 09 '21

Question Why does this light spread out so strange?

0 Upvotes

The point in the middle is as I'd expect but as it spreads out you see these chunks of radius that aren't decreasing in modularity by the pixel as I'd expect them to, rather by quite a few chunks of pixel. I've noticed this in 3D scenes too... why is that? How do I fix it?


r/GraphicsProgramming • • Jun 03 '23

Question How do arguments to entry point functions work?

0 Upvotes

When you have a shader with an entry point that takes some arguments, how does that input get assigned? For example: PS_INPUT VS_Main( uint vertexId : SV_VertexID )- where does vertexid come from? Does the semantic SV_VertexID make it run on every vertex in the vertex buffer? How does the index buffer play into it?

Thanks!


r/GraphicsProgramming • • Dec 13 '19

Best Multi-Api Rendering Engine

0 Upvotes

Must Be Well Documented And/Or Have A Lot Of Tutorials And Must Support DirectX 11, DirectX 12, Vulkan And Metal 2


r/GraphicsProgramming • • Feb 22 '23

Question Shader works in Unity Editor but not HoloLens 2

0 Upvotes

Hi all,

I’ve been writing a custom shader that takes in a ray-cast hit position (x, y, z) from an object in the scene that acts like a paint brush.

It paints on textures of any object that is “paintable” (this is done through a separate C# script that gets applied to all the objects that I want to be paintable in the scene) and inputting into the shader script.

Long story short, the shader script is correctly painting the objects in the scene when I run it in Play mode in the Unity editor.

But when I deploy it to the HoloLens 2 by building it out as a UWP application, it doesn’t “fully work”. Here’s what I mean by this:

Expected behavior: wherever the paintbrush is point to on the object, modify the pixel radius based on the brush size given and RETAIN the modified pixels on the texture.

What’s actually happening in the HoloLens 2: It creates a colored circle on the object of where the paintbrush where it’s currently pointing at. But when I move the brush to a different position it’s just the same circle following to that position and not retaining the modified pixels that were supposed to be previously drawn. Both the editor and the H2 are using Direct X 11 and this is being done in HLSL. It’s very odd to me that this works in the Editor with the HoloLens but not in UWP application.

I’m not looking for an exact answer but more so to see if I am just doing something completely wrong and understand a fundamental concept that I am misusing, advice on debugging this (cause I don’t know how to), etc.

Thanks.


r/GraphicsProgramming • • May 20 '22

Question Transform cube so that one face is positioned at x,y,z and the opposite face at x1,y1,z1

0 Upvotes

I'm trying to create a system that renders a "thick" line with OpenGL. What I was wanting to do is generate a transformation matrix for this cube so that given 2 points, one face will be placed at the first point and the opposite face at the other point. The scale part is easy, just compute the distance and scale the cube on the x, y or z axis. The translation is also not that difficult, just place the mesh at the middle point between the two given points.

My problem is with the rotation matrix...

Thanks.

Original: https://stackoverflow.com/questions/72321377/transform-cube-so-that-one-face-is-positioned-at-x-y-z-and-the-opposite-face-at


r/GraphicsProgramming • • May 26 '22

Looking to hire someone to help us with a graphics programming project (paid)

0 Upvotes

Hello, we want to explore proc gen / celluar automata use in a project either Unity or maybe in HTML / Java - we're a team of developers at (https://adv.gg) we work primarily in the twitch space with large esports teams. Doing something different with a major game developer. It's a novel approach to something. If anyone is interested please contact at [email protected]

We're looking for someone with chops and we're happy to compensate. We're looking to performance test a theory first and if it works then we would want to contract to build out. At least a multi-month project.


r/GraphicsProgramming • • Feb 08 '22

What is the relation between frond end development and graphics programming?

0 Upvotes

Part of me feels this might be a dumb question, but anyway. I am close to finishing my MSc in computer science. Last year I took a course in computer graphics in which I learned about WebGL, shaders, projective geometry, quaternions and things like that. For my exam I developed a game rendered on a canvas with these tools, I also implemented raycasting for mouse input, a skybox, shadowmaps and various light models for shading. I enjoyed it quite a lot! I also did another course in computer vision in which I studied more projective geometry.

Now I am getting an offer for a job for developing HMIs, but in the end it boils down to user interface development with reactjs I think. I realize it's not going to be about shader programming or graphics engines, but are these completely separate fields, or do they have in common some programming principles or theoretical background?

Thank you for any input.


r/GraphicsProgramming • • Feb 03 '22

Request [Job posting] Visual FX (game) programmer/artist (HLSL/GLSL)

0 Upvotes

Lumion is looking for a Visual FX (game) programmer (HLSL/GLSL)

Location: Remote work

Type: Full time

Salary: Negotiable

Are you a talented shader programmer/artist looking for a new challenge? Do you enjoy writing shader code, have a strong drive in researching and applying new techniques, and love creating new jaw-dropping effects? Is code like this what gets you out of bed in the morning? Then we are looking for you!

What we offer

  • Permanent full-time job

  • Great salary

  • Remote work possible

  • Friendly and fun work environment

  • We work no overtime

Requirements

  • Any work experience in shader programming (HLSL/GLSL) is a pro

  • However, if you’re great at HLSL/GLSL shaders, sheer talent can make up for a lack of work experience!

  • You are able to show some of your work

About us

Lumion is a visualization program for architects and runs on a custom DirectX 12 based 3D game engine. The technology is cutting edge and real-time. AR / VR / Metaverse, Ray tracing, RTX.

We are looking for a new colleague to join our development team. Your role will be pushing the visual boundaries of 3D rendering. Our focus lies beyond the quality you usually find in games. This offers an unique opportunity when your passion lies with programming 3d graphics. This is your chance to shine!

We're flexible in terms of work location. Part of our team works remote, others do work in our office in the Netherlands, near Amsterdam. We can help you relocate.

See more about Lumion here:

https://lumion.com/

Interested in the job? 

Then we would love to hear from you. Send the following to floyd [at] lumion.com (replace [at] with @): 

  • Your full name, CV, motivational letter, and/or portfolio

  • Your preferred rate per month in euros (€)

  • The date you can start working for us

Please write ‘Visual FX programmer: your name” in the subject line of the email


r/GraphicsProgramming • • Feb 24 '15

Voxel engine tutorial?

0 Upvotes

Does anyone know a good step-by-step tutorial on voxel engines? Maybe something like this, but one that actually works.


r/GraphicsProgramming • • Oct 20 '15

[Help] How to convert a thread ID into Screen Space Coord in an OpenGL Compute Shader? (x-post from /r/opengl)

Thumbnail
computergraphics.stackexchange.com
0 Upvotes

r/GraphicsProgramming • • Dec 13 '24

What's the Fastest CLI(Linux)/Python 3D Renderer? (GPU)

0 Upvotes

I have a bunch of (thousands of) 3d models in glb format that I want to render preview images for, I am using bpy as a python module right now. It's working but its too slow. The eevee renderer becomes cpu bottle-necked, it doesn't utilize the gpu as much, while the cycles renderer is too slow.

I just want some basic preview 512px images with empty backgrounds, nothing too fancy in terms of rendering features, if we can disable stuff like transparency and translucency to accelerate the process, I'm all for it.


r/GraphicsProgramming • • Nov 14 '23

Determining meters per second in scaled terrain

0 Upvotes

I have a terrain in OpenGL with a width of 199m and height of 99m and I'm scaling this train by 500. What would be 1 meter in the new terrain, would it be 500? I'm trying to move my character in meters per second and trying to figure out the correct speed amount to move him in meters per second.

I'm also trying to generate a random number for footballs speeds, where the balls can be shot at you ranging from 30 m/s to 400 m/s but I'm quite confused on the measurements to determine m/s. I thought 500 would be correct for 1 meter in the new terrain but this would then mean I would need to generate a random value between 30*500 and 400 * 500 which seems to crash. Would appreciate any insight into this

// Random number generator
float s = Random(20.0f * 500.0f, 400.0f * 500.0f);

float Random(float min, float max)
{ 
    float range = max - min;
    float randomNumber = (float) random() / (float) RAND_MAX;
    randomNumber *= range;
    return randomNumber + min;    
} 

r/GraphicsProgramming • • Apr 03 '26

GDC 2026 | Session Replays

Thumbnail
youtube.com
0 Upvotes

Our NVIDIA GDC 2026 session replays


r/GraphicsProgramming • • Jun 10 '26

Do you know any articles about how write base RenderGraph ?

0 Upvotes

Hi, I am writing my render graph for my complex rendering projects. I need to understand how to import textures, transient texture, when to rebuild graph, how to use it etc.

My version is bad (

#pragma once


#include <cstdint>
#include "Mad-RHI/Device.h"
#include <functional>
#include <string>
#include <vector>


namespace mad::common {


using RGTextureHandle = uint16_t;


struct RGTextureDesc
{
    rhi::TextureDimension Dimension = rhi::TextureDimension::Texture2D;
    uint32_t Width = 0;
    uint32_t Height = 0;
    union 
    {
        uint32_t ArraySize = 1;
        uint32_t Depth; 
    };
    rhi::TextureFormat Format = rhi::TextureFormat::R8G8B8A8_UNorm;
    uint32_t MipLevels = 1;
    uint32_t SampleCount = 1;
};


struct RGTextureEntry
{
    RGTextureDesc Desc;
    uint8_t ComputedBindFlags;
    rhi::RefPtr<rhi::Texture> PhysicalTexture;
};


struct RGPass
{
    std::string Name;
    std::function<void(rhi::CommandQueue*)> Execute;
    std::vector<RGTextureEntry> Reads;
    std::vector<RGTextureEntry> Writes;
};


class RGPassBuilder;


class RenderGraph
{
friend class RGPassBuilder;


public:
    RenderGraph(rhi::Device* device);


    void AddPass(std::string name, std::function<void(rhi::CommandQueue*)> execute,
        std::function<void(RGPassBuilder&)> setup);


    void Compile();
    void Execute(rhi::CommandQueue* queue);


    RGTextureHandle CreateTexture(RGTextureDesc desc);


private:
    rhi::Device* m_Device = nullptr;


    std::vector<RGTextureEntry> m_Textures;
    std::vector<RGPass> m_Passes;


};


class RGPassBuilder
{
public:
    RGPassBuilder(RenderGraph& rg, RGPass& pass);


    rhi::TextureView* GetTextureSRV(RGTextureHandle handle);
    rhi::TextureView* GetTextureRTV(RGTextureHandle handle);
    rhi::TextureView* GetTextureDSV(RGTextureHandle handle);


private:
    RenderGraph m_RG;
    RGPass m_Pass;


};


}#pragma once


#include <cstdint>
#include "Mad-RHI/Device.h"
#include <functional>
#include <string>
#include <vector>


namespace mad::common {


using RGTextureHandle = uint16_t;


struct RGTextureDesc
{
    rhi::TextureDimension Dimension = rhi::TextureDimension::Texture2D;
    uint32_t Width = 0;
    uint32_t Height = 0;
    union 
    {
        uint32_t ArraySize = 1;
        uint32_t Depth; 
    };
    rhi::TextureFormat Format = rhi::TextureFormat::R8G8B8A8_UNorm;
    uint32_t MipLevels = 1;
    uint32_t SampleCount = 1;
};


struct RGTextureEntry
{
    RGTextureDesc Desc;
    uint8_t ComputedBindFlags;
    rhi::RefPtr<rhi::Texture> PhysicalTexture;
};


struct RGPass
{
    std::string Name;
    std::function<void(rhi::CommandQueue*)> Execute;
    std::vector<RGTextureEntry> Reads;
    std::vector<RGTextureEntry> Writes;
};


class RGPassBuilder;


class RenderGraph
{
friend class RGPassBuilder;


public:
    RenderGraph(rhi::Device* device);


    void AddPass(std::string name, std::function<void(rhi::CommandQueue*)> execute,
        std::function<void(RGPassBuilder&)> setup);


    void Compile();
    void Execute(rhi::CommandQueue* queue);


    RGTextureHandle CreateTexture(RGTextureDesc desc);


private:
    rhi::Device* m_Device = nullptr;


    std::vector<RGTextureEntry> m_Textures;
    std::vector<RGPass> m_Passes;


};


class RGPassBuilder
{
public:
    RGPassBuilder(RenderGraph& rg, RGPass& pass);


    rhi::TextureView* GetTextureSRV(RGTextureHandle handle);
    rhi::TextureView* GetTextureRTV(RGTextureHandle handle);
    rhi::TextureView* GetTextureDSV(RGTextureHandle handle);


private:
    RenderGraph m_RG;
    RGPass m_Pass;


};


}

#include "Common/RenderGraph.h"


namespace mad::common {


RGPassBuilder::RGPassBuilder(RenderGraph& rg, RGPass& pass)
    : m_RG(rg), m_Pass(pass)
{


}


rhi::TextureView* RGPassBuilder::GetTextureSRV(RGTextureHandle handle)
{
    RGTextureEntry entry = m_RG.m_Textures[handle];


    entry.ComputedBindFlags |= rhi::RESOURCE_BIND_SHADER_RESOURSE;
    m_Pass.Reads.push_back(entry);


    return entry.PhysicalTexture->GetDefaultSRV().Get();
}


rhi::TextureView* RGPassBuilder::GetTextureRTV(RGTextureHandle handle)
{
    RGTextureEntry entry = m_RG.m_Textures[handle];


    entry.ComputedBindFlags |= rhi::RESOURCE_BIND_RENDER_TARGET;
    m_Pass.Writes.push_back(entry);


    return entry.PhysicalTexture->GetDefaultRTV().Get();
}


rhi::TextureView* RGPassBuilder::GetTextureDSV(RGTextureHandle handle)
{
    RGTextureEntry entry = m_RG.m_Textures[handle];


    entry.ComputedBindFlags |= rhi::RESOURCE_BIND_DEPTH_STENCIL;
    m_Pass.Writes.push_back(entry);


    return entry.PhysicalTexture->GetDefaultDSV().Get();
}


void RenderGraph::AddPass(std::string name, std::function<void(rhi::CommandQueue*)> execute,
    std::function<void(RGPassBuilder&)> setup)
{
    RGPass pass;
    pass.Name = name;
    pass.Execute = execute;
    
    RGPassBuilder builder(*this, pass);
    setup(builder);


    m_Passes.push_back(pass);
}


void RenderGraph::Compile()
{
    for (RGTextureEntry entry : m_Textures)
    {
        rhi::TextureDesc desc;
        desc.Dimension = entry.Desc.Dimension;
        desc.Width = entry.Desc.Width;
        desc.Height = entry.Desc.Height;
        desc.ArraySize = entry.Desc.ArraySize;
        desc.Depth = entry.Desc.Depth;
        desc.Format = entry.Desc.Format;
        desc.MipLevels = entry.Desc.MipLevels;
        desc.SampleCount = entry.Desc.SampleCount;
        desc.BindFlags = entry.ComputedBindFlags;


        m_Device->CreateTexture(entry.PhysicalTexture.GetAddress(), desc);
    }
}


void RenderGraph::Execute(rhi::CommandQueue* queue)
{
    for (RGPass pass : m_Passes)
    {
        pass.Execute(queue);
    }
}


RGTextureHandle RenderGraph::CreateTexture(RGTextureDesc desc)
{
    RGTextureHandle handle = m_Textures.size();


    m_Textures.push_back({ .Desc = desc });


    return handle;
}


}#include "Common/RenderGraph.h"


namespace mad::common {


RGPassBuilder::RGPassBuilder(RenderGraph& rg, RGPass& pass)
    : m_RG(rg), m_Pass(pass)
{


}


rhi::TextureView* RGPassBuilder::GetTextureSRV(RGTextureHandle handle)
{
    RGTextureEntry entry = m_RG.m_Textures[handle];


    entry.ComputedBindFlags |= rhi::RESOURCE_BIND_SHADER_RESOURSE;
    m_Pass.Reads.push_back(entry);


    return entry.PhysicalTexture->GetDefaultSRV().Get();
}


rhi::TextureView* RGPassBuilder::GetTextureRTV(RGTextureHandle handle)
{
    RGTextureEntry entry = m_RG.m_Textures[handle];


    entry.ComputedBindFlags |= rhi::RESOURCE_BIND_RENDER_TARGET;
    m_Pass.Writes.push_back(entry);


    return entry.PhysicalTexture->GetDefaultRTV().Get();
}


rhi::TextureView* RGPassBuilder::GetTextureDSV(RGTextureHandle handle)
{
    RGTextureEntry entry = m_RG.m_Textures[handle];


    entry.ComputedBindFlags |= rhi::RESOURCE_BIND_DEPTH_STENCIL;
    m_Pass.Writes.push_back(entry);


    return entry.PhysicalTexture->GetDefaultDSV().Get();
}


void RenderGraph::AddPass(std::string name, std::function<void(rhi::CommandQueue*)> execute,
    std::function<void(RGPassBuilder&)> setup)
{
    RGPass pass;
    pass.Name = name;
    pass.Execute = execute;
    
    RGPassBuilder builder(*this, pass);
    setup(builder);


    m_Passes.push_back(pass);
}


void RenderGraph::Compile()
{
    for (RGTextureEntry entry : m_Textures)
    {
        rhi::TextureDesc desc;
        desc.Dimension = entry.Desc.Dimension;
        desc.Width = entry.Desc.Width;
        desc.Height = entry.Desc.Height;
        desc.ArraySize = entry.Desc.ArraySize;
        desc.Depth = entry.Desc.Depth;
        desc.Format = entry.Desc.Format;
        desc.MipLevels = entry.Desc.MipLevels;
        desc.SampleCount = entry.Desc.SampleCount;
        desc.BindFlags = entry.ComputedBindFlags;


        m_Device->CreateTexture(entry.PhysicalTexture.GetAddress(), desc);
    }
}


void RenderGraph::Execute(rhi::CommandQueue* queue)
{
    for (RGPass pass : m_Passes)
    {
        pass.Execute(queue);
    }
}


RGTextureHandle RenderGraph::CreateTexture(RGTextureDesc desc)
{
    RGTextureHandle handle = m_Textures.size();


    m_Textures.push_back({ .Desc = desc });


    return handle;
}


}

r/GraphicsProgramming • • Mar 04 '21

Question Server-side Occlusion Culling (CSGO anti-wallhack)

0 Upvotes

Hello,

There has been a lot of interest in the CSGO community around anti-wallhack solutions. Number of larger youtubers such as Sparkles have done videos on external ESP cheats.

https://www.youtube.com/watch?v=y-WsV14o5lc

As a community I think we should discuss possible ways to solve this problem and how best to approach it.

For several years SourceMod devs (Source engine plugin) used the built-in ray tracing method. The problem with this method was it always executed on the primary thread and would cause performance issues even with a small number of ray traces. As well this method has a number of limitations that caused bugs even on official maps.

https://github.com/Silenci0/SMAC/blob/master/addons/sourcemod/scripting/smac_wallhack.sp

More recently the below Corner Culling Source Engine method was developed as an extension to the Source Engine. This method required manual mapping out of each map which worked OK for official maps, but many community servers have a large range of maps.

https://github.com/87andrewh/CornerCullingSourceEngine

https://github.com/87andrewh/CornerCulling

Even official maps have breakable windows and doors like cs_assault and de_canals. This adds a decent amount of complexity to handle.

Other anti-wall hack solutions from other games have used GPU offloading but not many dedicated servers have GPUs for game server hosting. As well the processing power for that method would most likely not work for large free to play games like CSGO.

PVS could be another approach but the problem I see with this method would be too low precision and still giving the cheaters a decent advantage.

What are your thoughts on this matter and how should this be approached?

Also, any developers interested in developing a CSGO anti wall hack. Please reach out to me direct to me directly.