#38 LWJGL Particle System - LWJGL Tutorials

preview_player
Показать описание
How to create a particle system to simulate explosions.

LWJGL is a Java library that allows you to create state of the art games using OpenGL.

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

You're welcome! I am glad you enjoy the tutorials.

TheCodingUniverse
Автор

A 3D series is something I have had on my list of things of things to do for a while. Next month I might have enough time to do this.

TheCodingUniverse
Автор

In essence, this has already been covered in the shader lighting video. I suggest you have a look at 'uniform arrays' in the GLSL specification.

TheCodingUniverse
Автор

It is possible to use multiple texture coordinates for one vertex using a built-in technique called multi-texturing.
You could use a large triangle or quad strip, but I am afraid adding or removing blocks would be cumbersome, because you would have to significantly change the entire array of VBO data.
Perhaps you might be interested in frustum culling and occlusion queries to enhance performance. Make sure you do not update the VBO data each frame; only when it is absolutely necessary.

TheCodingUniverse
Автор

You're welcome. I will keep up the videos.

TheCodingUniverse
Автор

Awesome demo! Maybe one on multitexturing next?

StellarWynd
Автор

If you add glBlendFunc(GL_ONE, GL_ONE) and glDisable(GL_DEPTH_TEST) before the place in your code where you actually draw the particles, OpenGL will ADD the particle's colors together, rather than have one overlap the other. This can give a nice, glowy, volumetric effect to the particles, and looks nice on things such as fire or other emmissive particle systems.

AdamLastowka
Автор

Could you tell me why you need separate texture coordinate for each new block? Are your blocks not instances of a finite number of block types, with a finite number of corresponding texture coordinates? I meant to say that you could store these block types in display lists.
Also, what do you mean by texture coordinate buffers?
The performance of display lists versus vertex arrays depends on your computer and the display list and VA implementations, so that's hard to say.

TheCodingUniverse
Автор

All of it :P Like 3D space and such, trigonometry, that stuff just scares me. It would be very cool to make a new series about a 3D game. Maybe I'll learn more. Thanks.

ComputerGuy
Автор

I have heard of LWJGL games being published on Steam, and it is also possible to distribute a custom launcher application like MineCraft.

TheCodingUniverse
Автор

No, the GLSL version 1.2 specification forces you to declare a uniform array with a size larger than 0.

TheCodingUniverse
Автор

Thanks for the tutorial really helpful!
I really like seeing your videos :)
Please keep it up :)

MzDayGaming
Автор

Yes, frustum culling is only for 3D. It seems I wrongly assumed your application was 3D.
It is not possible to have VBO vertex data in the form of a 2D array. glBufferData only supports one-dimensional array input.
The performance boost would probably be negligible, since in a 2D environment the total amount of block vertices would be small.
The way the engine is currently set up could be easily optimised by storing the pre-made quad in a display list.

TheCodingUniverse
Автор

how in the love of god does this video have the least views? i think this is the most interesting topic!!

MetsD
Автор

Thank you. It is because the video has only been out for two days.

TheCodingUniverse
Автор

Could you make a tutorial how to get the lighting work with more than 8 light points (maybe difference colors?) which are dynamic and are specified in the java code?

SirJavaGaming
Автор

See, the problem is, all of the tiles are stored on the same texture and If I just try to use normal texture coordinates, the tiles will be distorted. I need a way to bind multiple texture coordinates to the same vertex, which I was talking with Oscar about earlier. He said that there was a multitexturing feature that supported that, but I have no idea how to use it or where it is.

StellarWynd
Автор

Only in some cases, e.g. when you declare the array inside the main function. There is no way that I know of to pass an array of undefined size.

TheCodingUniverse
Автор

By the 2D array I meant storing the texcoords in a 2D array within the java program, then translating those into an interleaved VBO using an iterator (maybe bad idea?). Also, the problem with using display lists is that each tile definition has its own texcoord buffer associated with it. Unless you meant having a separate display list for each tile. If this were to be implemented, would it be better than vertex arrays? I'm trying to get a very fast framerate so can use GLSL Lighting later on.

StellarWynd
Автор

Isn't frustrum culling only for use with 3D geometry? and also, If I were to create a 2D array of vertexes and interleave the VBO/Array in such a way to make coordinate substitution easier, would the performance boost be worth the extra coding? Currently the engine just renders quads and translates the matrix depending on location of at tile on screen, which I can imagine results in a massive amount of duplicate vertexes.

StellarWynd