Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (868)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 35
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML 1.9.21 release on: 2020-03-29 11:55:40
Nope. And once in a while my neglectfulness of writing unit tests bites back. Smiley
2  Java Game APIs & Engines / Engines, Libraries and Tools / JOML 1.9.23 release on: 2020-03-29 09:04:04
Release notes:
Download via:
- ("Assets" section below)

The version 1.9.21 introduced two known bugs:
- Vector3f/4f.rotateX/rotateY/rotateZ() and Vector3f.cross() (fixed in 1.9.22)
- Matrix4.transpose() (fixed in 1.9.23)
3  Discussions / General Discussions / Re: Future employment trends? on: 2020-03-24 16:31:31
I would say that every service there has its valid use-cases. But no one on Earth would need _all_ of them at the same time. But the use-cases are definitely there. It just depends on the particular requirements that you have. If you want resilience/fault-tolerance, high availability, cost effectiveness (having low operational and maintenance costs), elasticity/scaling, being able to quickly iterate and have multiple teams with multiple different technological and process-related requirements, then you are going to cover many AWS services. Also, there surely was other things to learn as well, like the services the company is building themselves. So it was not _all_ learning AWS.
4  Discussions / General Discussions / Re: Future employment trends? on: 2020-03-24 15:09:12
I totally agree that Cloud know-how is becoming increasingly important. I have been with a customer (biggest German e-commerce company) for the last 1 and 1/2 years who has built their entire services architecture on AWS with an incredible degree of automation and templating to be able to quickly setup and integrate a new service including automating build/deployment via CI/CD and quickly recovering from a disaster (such as compromised AWS account).
You never SSH into a server or do things "manually" even on a web frontend there. Automation is a very big concern there and CloudFormation (AWS) or Terraform knowledge is important.
The learning curve to get acquainted with all that is incredible and it took the better part of the last year to understand and help develop inside one of the many feature teams I am part of.
There's also a nice presentation of how Sage uses AWS to quickly innovate/build new services:
I am currently learning for my upcoming AWS Certified Solutions Architect Associate Exam after having more than a year worth of daily practice with various AWS services. And they are really not kidding when they say that a recommended prerequisite for this certification is at least one year of experience building solutions with AWS.
5  Java Game APIs & Engines / Engines, Libraries and Tools / JOML 1.9.21 release on: 2020-02-22 13:05:28
Release notes:
Download via:
- ("Assets" section below)

Unrelated to that: Terasology has begun moving from using their own TeraMath to JOML with !
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2020-02-16 14:30:49
Wrote a little tutorial about the order in which matrix transformations can be viewed and what effect the different orders have:
Program used for the graphs/illustrations:
7  Game Development / Newbie & Debugging Questions / Re: LibGDX Drawing inter-penetrating 2D sprite in right order (Using 3D logic?) on: 2020-02-15 08:49:13
This is what shearing can be used for. You want to move the z coordinate of a rectangle with respect to its x or y coordinate while also keeping the x/y coordinates fixed. Here is a very basic LWJGL 3 example:
import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.system.MemoryUtil.*;
import org.lwjgl.opengl.GL;
public class OverlappingRectangles {
    private static void drawRectangle(float x, float y, float r) {
        glTranslatef(x, y, 0);
        glRotatef(r, 0, 0, 1);
        glScalef(0.75f, 0.2f, 1);
        // Create shear matrix that maps (x, y, z) to (x, y, x + z)
        glMultMatrixf(new float[] {
                1, 0, 1, 0,
                0, 1, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1});
        glVertex2f(-1, -1);
        glVertex2f(1, -1);
        glVertex2f(1, 1);
        glVertex2f(-1, 1);
    public static void main(String[] args) {
        if (!glfwInit())
            throw new RuntimeException("Unable to initialize GLFW");
        long window = glfwCreateWindow(500, 500, "Overlapping Rectangles", NULL, NULL);
        if (window == NULL)
            throw new RuntimeException("Failed to create the GLFW window");
        glfwSetKeyCallback(window, (w, k, s, a, m) -> {
            if (k == GLFW_KEY_ESCAPE && a == GLFW_RELEASE)
                glfwSetWindowShouldClose(window, true);
        while (!glfwWindowShouldClose(window)) {
            glColor3f(1, 0, 0);
            drawRectangle(0, 0.5f, 0);
            glColor3f(0, 1, 0);
            drawRectangle(0, -0.5f, 180);
            glColor3f(0, 0, 1);
            drawRectangle(-0.5f, 0, 90);
            glColor3f(1, 1, 0);
            drawRectangle(0.5f, 0, 270);

8  Discussions / General Discussions / Re: GPU programming article in January 2020 Oracle Java Magazine on: 2020-01-29 17:57:23
I think the article may be riddled with innaccuracy.

CUDA: Nvidia’s proprietary platform, which uses a subset of the C language
No? You can use full-fledge C++ even with classes and polymorphism with virtual functions in device code...
That guy definitely did not do any research.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2020-01-19 23:16:48
Great feature! deserves more stars! Smiley

Also, because this bugs me everytime I see it Wink
"Live CSS editing in the Game Engine I and @Guerra2442 are creating" or even better: "...@Guerra2442 and I are creating".
You also wouldn't say: "The milk that me am buying." You would say "The milk that I am buying."
Because I is the subject (the one acting) in this sentence. And it's no different when multiple subjects are present: "The milk that he and I are buying."
Also wrong (all subjects turned into objects): "The milk that him and me are buying."
Such mistakes become apparent when you simply leave one subject out of the sentence (omit "and me"): "The milk that him is buying."
An enumeration of multiple subjects does not suddenly turn a subject ("I" or "he" as someone acting) into an object ("me" or "him" as someone being acted upon).
It is always I in such cases and never me.
10  Games Center / WIP games, tools & toy projects / Re: An Asteroids-Like Shooter Called Core Shot on: 2020-01-10 22:33:57
You have hardcoded absolute file paths in your class files... this will definitely not work.
zipgrep 'D:\\pics\\blue_sound' coreshot.jar 
com/nigel/soundwavesgame/Level5.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level8.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level4.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level2.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level6.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level10.class:Binary file (standard input) matches
com/nigel/soundwavesgame/BlueSoundGame.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level9.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Rocket.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level7.class:Binary file (standard input) matches
com/nigel/soundwavesgame/Level3.class:Binary file (standard input) matches
com/nigel/soundwavesgame/objects/Target.class:Binary file (standard input) matches
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2020-01-08 11:23:49
Refactored all uses of
1.0 / sqrt(x)
into a separate method and found a few cases where
float v = (float) (1.0 / Math.sqrt(x));
was used instead of the much faster
float v = 1.0f / (float) Math.sqrt(x);
(with a
float x;
The first uses a double-precision vcvtss2sd cast, followed by vsqrtsd square-root, vdivsd and a vcvtsd2ss cast, whereas the latter uses the much faster two single-precision instructions vsqrtss and vdivss.
So, even though java.lang.Math.sqrt(double) takes a double, the JVM will see that you cast the result immediately to a float and omit the argument cast to double as well as the return value cast to float, but use the single-precision intrinsic.
(besides: it's such a shame, that Java does not expose vrsqrtss...)
EDIT: The same btw. goes for Math.sin/cos.
12  Discussions / General Discussions / Re: Games of the Decade on: 2020-01-02 18:39:02
My personal top 1 of the previous decade, which I played the most by far:

1. BEAT SABER (2018) (on Oculus Rift)
13  Java Game APIs & Engines / Engines, Libraries and Tools / JOML 1.9.20 release on: 2020-01-01 13:10:56
JOML is continuing to pump out new releases every now and then.
Release notes for 1.9.20:
Download via:
- ("Assets" section below)
- (as addon in the "Addons" section)
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-12-30 22:23:57
Re-evaluated java.lang.Math.fma() for performance again. I did an evaluation with JDK 9, where it actually was slower than a manual multiplication and addition, but now the situation changed (at least with JDK 12 and JDK 14).
Benchmark of JOML's methods:
Benchmark           Mode  Cnt   Score   Error  Units
Without fma JDK 14
Matrix4f.invert     avgt    5  24,695 ± 0,179  ns/op
Matrix4f.mul        avgt    5  15,308 ± 0,081  ns/op
Matrix4f.mulAffine  avgt    5   9,588 ± 0,065  ns/op
Without fma JDK 12
Matrix4f.invert     avgt    5  23,706 ± 0,429  ns/op
Matrix4f.mul        avgt    5  15,279 ± 0,322  ns/op
Matrix4f.mulAffine  avgt    5   9,152 ± 0,087  ns/op
With fma JDK 14
Matrix4f.invert     avgt    5  21,583 ± 0,093  ns/op
Matrix4f.mul        avgt    5  11,779 ± 0,110  ns/op
Matrix4f.mulAffine  avgt    5   8,333 ± 0,124  ns/op
With fma JDK 12
Matrix4f.invert     avgt    5  20,997 ± 0,382  ns/op
Matrix4f.mul        avgt    5  12,330 ± 0,146  ns/op
Matrix4f.mulAffine  avgt    5   8,323 ± 0,137  ns/op

Now, it is very unfortunate that the JDK does not contain a method to check whether FMA3 instructions are actually supported by the CPU...
So one can either hope that they are supported and get better performance by the JIT emitting such instructions or one gets abyssimal performance by BigDecimal approximations when using java.lang.Math.fma() but the CPU not supporting it. So I end up having a small JNI library querying cpuid().
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-12-21 09:52:24
Never did anything with participating media. So I gave the paper "Importance Sampling Techniques for Path Tracing in Participating Media" a go:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

By the way, here are two collections of (probably all) papers, dissertations and presentations on "Light Transport" and "Sampling", assembled and shared by Max Tarpini:
- "Light Transport":
- "Sampling":
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-12-09 18:48:08
Wrote my first serious StackOverflow answer on a topic I was researching further for the tutorials anyways.
So if anyone is interested in what the NDF in Microfacet Theory exactly is and why it can have values between `0.0` and `+inf`, then this is also for you. Smiley
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-12-04 17:50:41
I knew of this site:
Having a voxel model, though, massively simplifies things such as physics and general game-play (if one were to extend it to a playable demo/game) and authoring for custom models/scenes is hugely simplified with MagicaVoxel compared to a mesh editing tool. But thanks for suggesting!
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-12-03 23:30:51
While still working on the tutorials, I was wondering what the end result would be and which scene setup to use for all steps in-between from start to end so that it would still present itself somewhat interesting (aka. "not rendering a simple sphere on a plane...").
So I ended up looking at various MagicaVoxel models and I like the "rooms.vox" model shipped with MagicaVoxel the most. It has very interesting features, such as some emissive surfaces and all in all interesting geometry while being a voxel model. And it's not as abstract as for example the "menger.vox" model.
Additionally, the city-themed modular models from are fantastic as well.
So here is just ray traced hard shadows with visualized normals of the room.vox model
(OpenGL 3.3, GLSL 330 core, everything in buffer textures, model has 82,536 voxels which are reduced to 1,280 merged 'cuboid' voxels for which a kd-tree is built and traced in GLSL with AABB/ray intersection tests for the voxels):

EDIT: Visualization of the difference between previous "voxel merging" which only worked a single y slice at a time (just like greedy meshing only works a single slice of one of the three dimensions) and optimized merging which also tries to merge a xz-slice along the y-direction (first unoptimized resulting in a total of 1,280 voxels, second optimized resulting in 367 voxels):

Additional seemingly unnecessary splits (missed merges) are due to splits later introduced by the kd-tree build.
19  Discussions / Miscellaneous Topics / Re: What I drew today on: 2019-11-29 20:58:36
Today I tried various approaches to illustrate via diagrams/drawings while explaining:
- animation in Adobe Animate
- animation in CSS3
- drawing on a tablet in Autodesk Sketchbook
Adobe Animate and CSS3 can produce good animations, with Animate having much higher productivity, even if you are fluent in CSS3 animations. However, if you don't need animations to drive home a certain point, I actually preferred developing an illustration step by step while explaining. It's just so much quicker drawing a line or pointer here and there and quickly undoing it later while using ruler/circle helpers for accuracy when something in the drawing should persist for later and should not look like drawn by a two-year-old, since I basically have zero drawing skills - making this statement probably an insult to two-year-olds. Smiley

20  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-11-22 20:37:09
This evening is more preparing of tutorial materials. In particular, for understanding the rendering equation and radiometry, the three most frequently used terms (radiant flux, radiance and irradiance), understanding what an integral is, why we need a surface integral over the hemisphere, why the integral over the unit hemisphere is `2π`, why that is also the solid angle subtended by that hemisphere, why the irradiance with constant radiance `L` is `π·L` and not `2π·L`, why a lambertian BRDF function is defined as `c/π`, why a BRDF can evaluate to infinity, what Monte Carlo integration is, what a probability density function (pdf) is, why the pdf of a randomly chosen vector over the hemisphere is `1/(2π)` and why the hell we should need all of this when building a physically correct path tracer.
And I constantly lose grasp of certain things and have to re-read them.
Also, there is a nice explanation video about the rendering equation , though I pm'ed Eric Arnebäck on Twitter about a slight error: BRDF evaluating to 1 does not equate to all light from omega_i reflecting towards omega_o - if that were the case, the BRDF would essentially represent a perfect mirror and would need to be the dirac delta function evaluating to infinity for that pair of directions, since the cosine-weighted BRDF still needs to integrate to <= 1 over the hemisphere).

EDIT: Just saw that the original James T. Kajiya paper "The Rendering Equation" from 1986 gives the answer to why it's possible for basically all path tracers today to approximate the recursively defined rendering equation using an iterative process by following a light path over multiple bounces and accumulating the received light: It has got to do with reformulating the so called "Fredholm integral equation of the second kind" (of which the rendering equation is an example) into an infinite series (the Liouville–Neumann series), of which one can simply evaluate only the first `n` summands, where the first summand is just the direct light from a light source to the eye, the second summand is light from a source to a point on a surface and then to the eye, the third summand is light hitting two surfaces before reaching the eye, and so on.
I never understood why it works this way.
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-11-20 21:14:32
 Smiley yes, there are plenty of written tutorials, with and without code. If I were to recommend one, then I'd definitely say: the now free pbr book and also scratchapixel.
EDIT: Oh and I just found this while researching the advantages/disadvantages of Riemann sums compared to Monte Carlo integration: (really awesome article about the fundamentals of path tracing)
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-11-20 20:40:24
What kind of tutorials are you making?
Like I wrote above: Raytracing with OpenGL.
I've searched YouTube a bit and actually did not find any good tutorial that has all of the following:
- development of executable code other than C/C++
- explanation of the stuff
- having raytracing as topic and not your standard good old rasterization
So, today was more illustration drawing, like this one:
23  Discussions / General Discussions / Re: C++/Java Engine without GC in graphics on: 2019-11-20 19:52:52
Yes, but that is definitely not what i described, this optimization you mentioned only affects local throwaway objects but not large persistent object arrays if i understand you correctly. I'll have to wait for project Valhalla i guess.
Ah, yes, I see. I misunderstood you there, I guess.
24  Discussions / General Discussions / Re: C++/Java Engine without GC in graphics on: 2019-11-20 19:30:53
Such an optimization exists for ages and the JIT will eliminate object allocations and decompose an object into its fields whenever the object does not escape the "inline scope" which the JVM uses to optimize a method call stack and performs escape analysis with.
If you have relatively tight loops, not too deep call stacks and no allocated object escapes then it is very likely that no object allocation is actually happening. JITWatch provides more insights into this.
However, since this relies on the inlining and escape analysis to work it out automatically and your object not escaping, it is prone to fail in some circumstances - simply because your method size or call stack size exceeds some arbitrary limit and the JIT then just saying "nope".
Project Valhalla will solve this once and for all with Value Types, requiring the programmer to hint to the JVM that he/she does not care about object identity.
I do agree with @bullen, that the lack of SIMD and a few other missing CPU intrinsics is a big point in performance. Together with the arbitrary inlining thresholds in the JVM (which can be configured, though) giving you totally unpredictable runtime behaviour.
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-11-17 15:26:07
Have been working on the script and implementation for a YouTube tutorial about raytracing with OpenGL and I finally got a nice OBS + Visual Studio Code + Browser Window with WebGL 2 rendering setup. I chose JavaScript/TypeScript + WebGL + Webpack + livereload because it is a sooo much smoother experience compared to Java and... well... OpenGL is just OpenGL regardless of the language.
Video where I try the OBS setup:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
26  Game Development / Newbie & Debugging Questions / Re: [lwjgl] GL33 function replacements for GL31 on: 2019-11-13 14:41:54
So i replaced
GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, texture, 0);
GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0);
Is this correct?
No. Obviously, in the first call you were attaching a texture to the depth attachment of your FBO, whereas in the second call you are now using the color attachment 0. Those are two different things. You probably meant to use GL_DEPTH_ATTACHMENT in the second call as well.

glVertexAttribDivisor is only available since OpenGL 3.3. If you want to use OpenGL 3.1, then you can only rely on the extension GL_ARB_instanced_arrays being available. So test for this extension in the GLCapabilities object and if it is true/available, use it via ARBInstancedArrays.glVertexAttribDivisorARB().
27  Java Game APIs & Engines / OpenGL Development / Re: AABB and transformations on: 2019-11-10 13:48:55
You can use instancing as well, and just use the AABBs' buffer object as an instanced vertex attribute in the shader. The choice is yours. I mean, how did you render the untransformed AABBs in the first place? Just use the same mechanism for the transformed AABBs.
By the way, I added AABB.transform(Matrix4) to the latest 1.9.20-SNAPSHOT version of JOML, if you'd like to use that to transform the AABBs:
28  Java Game APIs & Engines / OpenGL Development / Re: AABB and transformations on: 2019-11-10 10:48:55
The rendering logic is based on batches and instanced rendering.
And what keeps you from doing it this way with the transformed AABBs as well? Just transform your AABBs, upload all of them into a single VBO and render all of them with a single draw call, if that is what you did with the untransformed AABBs.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-11-02 09:52:23
Can the technique be integrated with normal shadow casting?
If you mean z-buffer techniques like shadow mapping, then yes. Just pick your preferred method of estimating/approximating the occluders (percentage-closer filtering, variance shadow mapping, shadow mapping by backprojection, ...). All methods for area light soft shadows apply here.
Btw.: Here are some pics with multiple lights:

EDIT: Added a quick GGX raytraced image for validation that the analytic result is actually (very close to) correct. This is not yet the solution proposed in the "Combining Analytic Direct Illumination and Stochastic Shadows" paper but just solely raytraced (left is the LTC analytic solution, right is completely raytraced):

EDIT2: Here is a video:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2019-11-01 16:16:56
Just implemented the SIGGRAPH 2016 paper Real-Time Polygonal-Light Shading with Linearly Transformed Cosines into my OpenGL test scene code:
(image only shows the specular GGX contribution)

The lighting calculation is completely analytic and very cheaply done in the shader without any stochastic elements like Monte Carlo integration - so no noise.
But note the lack of shadows from the table. Eric Heitz has a recent solution for this as well: Combining Analytic Direct Illumination and Stochastic Shadows
The solution of that paper is to calculate the direct lighting analytically (without shadows) and then use stochastic ray tracing to compute the occlusion factor, which is then blurred/denoised. The advantage of doing it this way is that this completely avoids any noise/variance whenever the light is completely visible from the sample point.
So, when having polygonal light sources (such as a rectangle) or basically any light shape for which analytic solutions exist (sphere, ellipsoid, disk, line, ...) one would never only just sample the light source area or the solid angle, but use the closed analytic solution and perform stochastic sampling only to compute the amount of shadow (hence the name "shadow ray").
I just love people like Eric Heitz who contribute to the research on ready applicable real-time rendering techniques.

EDIT: Here is a video showing GGX with varying roughness:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
Here is a very nice explanation of the "Linearly Transformed Cosines" technique:
Pages: [1] 2 3 ... 35
Riven (578 views)
2019-09-04 15:33:17

hadezbladez (5495 views)
2018-11-16 13:46:03

hadezbladez (2398 views)
2018-11-16 13:41:33

hadezbladez (5756 views)
2018-11-16 13:35:35

hadezbladez (1219 views)
2018-11-16 13:32:03

EgonOlsen (4659 views)
2018-06-10 19:43:48

EgonOlsen (5667 views)
2018-06-10 19:43:44

EgonOlsen (3193 views)
2018-06-10 19:43:20

DesertCoockie (4093 views)
2018-05-13 18:23:11

nelsongames (5104 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!