OpenGL Tutorial 17 - Transparency & Blending

preview_player
Показать описание
In this tutorial I'll show you how to easily integrate transparency into your OpenGL project, and how to make use of the blending function.

*Source Code & Models*

*OpenGL Documentation*

*Discord Server*

*Patreon*

*Timestamps*
0:00 Introduction
0:10 RGBA
0:25 Transparency
0:53 Adding Windows
1:21 Blending Theory
2:50 Implementing Blending
3:11 The Problem with Blending
3:33 Solution
4:26 Disclosure & Ending

*References*

#opengl #opengltutorial #computergraphics #cpp #visualstudio
Рекомендации по теме
Комментарии
Автор

discovered your channel a couple of days ago and absolutely loving the content. It's a godsend especially since I started learning opengl a couple of weeks ago. Keep it up man, looking forward to more tutorials!

fudgeracoon
Автор

Thank you for this, I was looking for a way to not render the alpha channel of my sprites. And the discard keyword was exactly what I needed. Thanks again!

gamemakertim
Автор

Just really appreciate your explaining when I need it!

serein
Автор

Hope to see your next video as soon as possible!!!

PhamAnhKhoa
Автор

A small note for this video. You need to add the TRS transformations as inputs to the Draw function from the model class. Look at the source code (Model and Mesh classes, both the header files and cpp files, I only changed the Draw functions) to see exactly what I mean :)

VictorGordan
Автор

low-level graphics programming is extremely interesting

ИгорьСечко-ми
Автор

How to do the grass blend without the grass being transparent?Which blend mode source and destination you used?

lanchanoinguyen
Автор

Victor you are wonderful <3, have you already thought of something about Vulkan ??

SAMUSTORM
Автор

wouldn't it be time consuming if we have large number of Objects in our scene and we have to sort them each time in the loop based on the camera position? This will reduce the fps too.

sumitgupta
Автор

my dear teacher, when will i can get your new video.

keep on this, you are the best

把嘴缝起来
Автор

4:48 what other weird methods are you talking about? I have tried looking online but wasn’t able to (I'm sure it’s just my horrible searching skills.) Could you share some resources?

silvertakana
Автор

for some reason, when i tried to delete the code for the windows, it didn't work, it just left me with a grass texture with black background, only happens when i don't draw it, if i draw only one, it works, but when i don't draw any window, it doesn't work, deleting the whole code for windows from the main file also doesn't work, switching release to debug also doesn't work, i'm lost

lukasjetu
Автор

What should I do when two meshes are in the same position but one's like the outer layer of the other, for example a head and a bunch of planes that simulate hair? Applying sorting wouldn't work since both are in the same position. I also tried the "if alpha is less than .1 then discard" but I still get the inner layer completely gone

generalratchet
Автор

I have a problem. When running the project in debug mode in Visual Studio it runs fine but when I build the project and then run the exe it gives a Visual C++ runtime library error.

rudrasingh
Автор

What is the source and what is the destination ?

diogobatista
Автор

Why are you telling us this in a bunch of code? Is this so hard . Wouldn't it be simpler if you draw 2 rectangles and explain?

cbk
Автор

Thank you for wasting almost five minutes of your viewer's time, just to tell them at THE END of the video, that you're NOT going to explain how to get transparency working right....

iUniversEi