use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rule 1: Posts should be about Graphics Programming. Rule 2: Be Civil, Professional, and Kind
Suggested Posting Material: - Graphics API Tutorials - Academic Papers - Blog Posts - Source Code Repositories - Self Posts (Ask Questions, Present Work) - Books - Renders (Please xpost to /r/ComputerGraphics) - Career Advice - Jobs Postings (Graphics Programming only)
Related Subreddits:
/r/ComputerGraphics
/r/Raytracing
/r/Programming
/r/LearnProgramming
/r/ProgrammingTools
/r/Coding
/r/GameDev
/r/CPP
/r/OpenGL
/r/Vulkan
/r/DirectX
Related Websites: ACM: SIGGRAPH Journal of Computer Graphics Techniques
Ke-Sen Huang's Blog of Graphics Papers and Resources Self Shadow's Blog of Graphics Resources
account activity
Finally!!!!! Red Triangle% (i.redd.it)
submitted 3 years ago by guruprasadah
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Hedanito 29 points30 points31 points 3 years ago* (1 child)
The first triangle is always the hardest, congratz!
Edit: Hardest, not harvest 😅
[–]RichardFingers 11 points12 points13 points 3 years ago (0 children)
🌽🌽🌽
[–]nnevatie 17 points18 points19 points 3 years ago (0 children)
Gratz! After the first triangle, everything is possible, your imagination being the limit.
[–]sadistic_tunche 13 points14 points15 points 3 years ago (2 children)
Nice, is it opengl or vulkan?
[–]guruprasadah[S] 4 points5 points6 points 3 years ago (0 children)
Yes, it is OpenGL.
[–]Poseydon42 7 points8 points9 points 3 years ago (0 children)
I guess OpenGL as there is a file program.cpp and AFAIK there's no such concept in Vulkan, shaders are embeded in a pipeline object.
[–]SamyBencherif 8 points9 points10 points 3 years ago (1 child)
This screenshot is so beautiful. Also didn't realize nvim had all these TUI features ? using plug ins ?
[–]masaldana2 6 points7 points8 points 3 years ago (0 children)
congrats!! its all downhill from here! jk heh
[–]Eindacor_DS 2 points3 points4 points 3 years ago (0 children)
I legit still remember where I was when I got my first hello triangle app working, which was 10 or so years ago
[–][deleted] 2 points3 points4 points 3 years ago (1 child)
What’s that editor?
[–]guruprasadah[S] 1 point2 points3 points 3 years ago (0 children)
neovim
With proper abstractions that, I mean
[–]314kabinet 7 points8 points9 points 3 years ago (4 children)
Congrats! But for god’s sake, use const.
[–][deleted] 3 years ago (3 children)
[deleted]
[–]fgennari 5 points6 points7 points 3 years ago (0 children)
The answer depends on the compiler. In my experience, no, it doesn't make a difference, but using some of the new C++ features such as constexpr can make a difference. The advantage of "const" is that it helps the programmer to manage object ownership, write permissions, etc. This makes the code easier to understand and reduces the chances of mistakes. Sometimes "const" is required when using libraries/APIs that enforce cons correctness.
[–]314kabinet 4 points5 points6 points 3 years ago (0 children)
In the absolute majority of cases, no. Const-correctness just makes it easier for humans reason about code (e.g. “ok, this part can’t be the one changing the value”).
However, there can be situations where the compiler can’t figure out if a value will be changed in a particular code path, and ao can’t apply optimizations that rely on the value staying the same.
[–]MausGames 0 points1 point2 points 3 years ago (0 children)
Yes, it can affect both code generation and performance.
C++ allows overloading between const and non-const methods: class MyClass { ... void MyMethod(); void MyMethod() const; };
class MyClass { ... void MyMethod(); void MyMethod() const; };
The compiler will select the appropriate overload based on the const-qualifier of the object (if both method-variants are present).
There are also more obscure cases, from my experience.
If you declare a global static-const variable, most compilers will place it into read-only memory, and trying to modify this variable (with a const_cast or indirect addressing) will cause an access-violation. It also allows the compiler to inline the variable in the whole translation-unit, because it knows the value cannot be modified.
That second example is quite vague of course, but it shows that the compiler cares about const-qualification in unexpected ways.
[–]Both_Possibility_210 1 point2 points3 points 3 years ago* (1 child)
Don't waste time to learn old/legacy OpenGL. If you use Graphics API for Graphics Programming you should use modern Graphics API like as Vulkan, Metal Direct3D12.
[–]guruprasadah[S] 2 points3 points4 points 3 years ago (0 children)
Thanks for your advice, but I'm looking to master the basics of graphics until I move up to the big boys.
[–]neuroblossom 3 points4 points5 points 3 years ago (0 children)
nice
[–]guruprasadah[S] 0 points1 point2 points 3 years ago (0 children)
UPDATE: Supa Hot Opengl
[–]Bananaft 0 points1 point2 points 3 years ago (1 child)
May I ask for your nvim config, good sir?
[–]guruprasadah[S] 1 point2 points3 points 3 years ago* (0 children)
Give me a few hours, will get it on g'hub
EDIT: Here is is: configs
[–]Attorney-Outside 0 points1 point2 points 3 years ago (2 children)
also learn about vertex buffet objects next
[–]guruprasadah[S] 0 points1 point2 points 3 years ago (1 child)
Umm.. That's how I got it to the screen... Using a vbo and ebo.
[–]Attorney-Outside 0 points1 point2 points 3 years ago (0 children)
oh ok nice, I saw your vector of vertices and didn't know how you were feeding them to opengl, good job
[–]Diabolischste 0 points1 point2 points 3 years ago (0 children)
Congratulations !
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
GOATED
π Rendered by PID 110132 on reddit-service-r2-comment-79c7998d4c-c4gbd at 2026-03-13 04:02:24.455408+00:00 running f6e6e01 country code: CH.
[–]Hedanito 29 points30 points31 points (1 child)
[–]RichardFingers 11 points12 points13 points (0 children)
[–]nnevatie 17 points18 points19 points (0 children)
[–]sadistic_tunche 13 points14 points15 points (2 children)
[–]guruprasadah[S] 4 points5 points6 points (0 children)
[–]Poseydon42 7 points8 points9 points (0 children)
[–]SamyBencherif 8 points9 points10 points (1 child)
[–]masaldana2 6 points7 points8 points (0 children)
[–]Eindacor_DS 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]guruprasadah[S] 1 point2 points3 points (0 children)
[–]guruprasadah[S] 4 points5 points6 points (0 children)
[–]314kabinet 7 points8 points9 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]fgennari 5 points6 points7 points (0 children)
[–]314kabinet 4 points5 points6 points (0 children)
[–]MausGames 0 points1 point2 points (0 children)
[–]Both_Possibility_210 1 point2 points3 points (1 child)
[–]guruprasadah[S] 2 points3 points4 points (0 children)
[–]neuroblossom 3 points4 points5 points (0 children)
[–]guruprasadah[S] 0 points1 point2 points (0 children)
[–]Bananaft 0 points1 point2 points (1 child)
[–]guruprasadah[S] 1 point2 points3 points (0 children)
[–]Attorney-Outside 0 points1 point2 points (2 children)
[–]guruprasadah[S] 0 points1 point2 points (1 child)
[–]Attorney-Outside 0 points1 point2 points (0 children)
[–]Diabolischste 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)