OpenGL 3D Game Tutorial 48: Multiple Render Targets

preview_player
Показать описание
LWJGL tutorial series on how to create a 3D Java game with OpenGL!

Rendering to multiple targets this week.

At 9:45 on some systems you will ONLY see the red entities, and not the rest of the scene. This is because so far we've only explicitly specified the entity fragment shader to render something to color attachment 1. This isn't a problem, so just continue with the tutorial.

End of video music- Kai Engel, "Waking Stars":

Рекомендации по теме
Комментарии
Автор

Hey ThinMatix! Just wanted to thank you for these awesome tutorials! They never fail to be helpful! This tutorial especially helped me because this is something that I have been trying to accomplish for weeks now. Thank you!

micaht
Автор

socuwan seriously was the game I've was looking forward to the most above all other games! You started and stuck with it with out a ton of money but you are doing great and I also love the smaller games... keep up the FANTASTIC job. You are unbelievable!!!

SorenHigh
Автор

Deferred shading seems like a useful thing to know.

phil-gdes
Автор

This answered a few questions I had. Thanks for this tutorial!

zeroth
Автор

Do a tutorial for 16-bit HDR rendering, please!:) Make sure to include tone mapping and eye adaptation.

AdriansNetlis
Автор

Could you continue with this series please, and also hope you get better😀


Please if u proceed do a multilplayer tutorial on this game thz😉

Petereoooo
Автор

When you speak fast, it must mean your brain works much faster than your speech and that you probably have great dexterity. I have noticed this in geniuses. Those who speak fast also have agile hands and fast brains.

Thanks for great videos, I was looking for infos on buffers, before coming here. Thanks.

pinklady
Автор

verry helpful video
(as always)

hope you find some time for the multiplayer serie soon

slimelp
Автор

At 9:45 on some systems you will ONLY see the red entities, and not the rest of the scene. This is because so far we've only explicitly specified the entity fragment shader to render something to color attachment 1. The other fragment shaders still just have one output, and we haven't specified where they should be rendering to. On my system it seems to default to rendering to both color attachments, but on other systems it may default to only rendering to color attachment 0. This isn't a problem, so just continue with the tutorial.

ThinMatrix
Автор

All this bloom effects reminds me of The Legend Of Zelda: Twilight Princess. Am I the only one ?.

nasso_
Автор

Hi, I use this tutorial to built a g-buffer (color, normals, depth, positions), but with this I made Ambient Oclussion from other examples, but my problems is when I go to calculate lights, the position buffer is kind of problem

can I pass my code for you analize?

djava
Автор

Hi ThinMatrix, These tutorials are simply amazing, I have followed them for quite a while and made several forks of the project for other purposes, one being a Desktop Environment for Linux, another being a GL powered Graphical Interface for other Java programs.

While optimizing some of my code I noticed something about the loader.loadTexture() method, I don't know if you have noticed (if you have, feel free to ignore my ramblings haha) but every time the load method is called it reads a texture file from the /res folder regardless of if the texture has already previously been loaded. This is fine, but possibly a performance dip if the same texture is loaded to multiple objects (i.e. reading the same texture file and creating a new ID for it). I re-wrote the method to store texture ID's in a HashMap with a String (or Integer hashCode of the name) as the key and the textureID as the value. I modified the loadTexture method to check the map to identify if the map already contains a texture with the name specified and if it does, return the existing texture ID, else load the texture. Something like this:

public int loadTexture(String fileName) {
Texture texture = null;
int textureID = 0;

{
textureID = textures.get(fileName);
} else {
try {
/* load texture */
} catch (Exception e) {
/* exception handling */
}
/* put the new texture in the map of textures */
textures.put(fileName, texture.getTextureID());

textureID = textures.get(fileName);
}
return textureID;
}

I don't see it as much of a problem if the game is small and there isnt a huge collection of texture assets, but for bigger games, if there is a texutre used a multitude of times then I think it could be significant performance hit trying to load (especially if the loading happen on the fly) the same texture multiple times from the disk, as opposed to simply retrieving the already existing texture ID.

What are your thoughts on the subject?

p.s. sorry for the really long post :p

neravellir
Автор

At this stage of tutorials would we have enough experience to program something like Equilinox or a just any 3d game with the same level of graphics quality of Equilinox (Given Enough time of development of course)

wavegunner
Автор

If I wanted to only draw one of my entities to the second buffer, how would I go about doing that without drawing the black shape?

tingraphix
Автор

Still waiting for animation tutorial, make sure you''ll do it before ending this tutorials serie please :) and thanks for your efforts .

kurosakibyakuya
Автор

canal you belo me, i Wagner a main menu screen soo when i Open the game it gets more beauty !Thz and a hug!

agente
Автор

Once again great tutorial and vidio, what would you cover next time?
And one more answer, what do you think about scripts support integration, for example lua, I`m tring it now in my project and I it`s usefull si much P.S. I`m writing on c++ and have libraries for it don`t now about libraries for java

obivan
Автор

Why don't you use the primitive array overloads of the gl functions? Allocating an offheap buffer every time seems unnecessary...

TheMrKeksLp
Автор

are you going to do a tutorial on deferred rendering soon to improve lighting? after that I'm pretty much done with rendering and can get on with other game stuff like physics.

Luke-zryc
Автор

why didn't you use a colorTexture array?

cookingandjava