Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (734)
Games in Android Showcase (222)
games submitted by our members
Games in WIP (811)
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 ... 15
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGDX How do I get the depth buffer from FrameBuffer? on: 2017-08-05 14:31:34
The same way you attach a colour buffer. Check out the "attachment" parameter.

If it's just a depth buffer then it is GL_DEPTH_ATTACHMENT and for a depth and stencil buffer you want GL_DEPTH_STENCIL_ATTACHMENT.
2  Game Development / Game Mechanics / Mixed partial derivatives for a surface from surface normals for bicubic interpo on: 2017-08-05 14:27:45
So I'm trying to construct continuous terrain from discretely sampled height values and accompanying surface normal using bicubic interpolation.

Brief description of bicubic interpolation for the maths minded who haven't encountered it before:
Given any function f(x,y), bicubic interpolation constructs a bicubic polynomial which can be used to interpolate in the range (0,0) - (1,1) from the values of f, f x , fy and fxy (aka f, df/dx, df/dy and d2f/dxdy) at the points (0, 0), (1, 0), (0, 1) and (1, 1). Ie given the values and first derivatives at the corners of the unit square you can interpolate the value (or indeed derivative) at any point inside that square. The nice thing about cubic interpolation is that it produces continuous derivatives. 

So lets say I've got a surface described by z = f(x, y). Now I've related the surface normal to the partial derivatives in x and y by taking the cross product of the vectorized gradients in x and y. Ie Surface Normal, N (not normalised).
N = [0, 1, fy] x [1, 0, fx] = [-fx, - fy, 1]
But really I'd like to be able to calculate all the partial derivatives (ie fxy as well) from the surface normal and the height and I haven't been able to figure out a way to do this beyond numerical differentiation which ideally I'd like to avoid.

Anyone have any thoughts?

3  Discussions / Miscellaneous Topics / Re: Humble monthly keys on: 2016-11-11 15:27:37
I remember "Styx: Master of Shadows" looked really neat when it came out. If that's still going I'd love that one please?
4  Discussions / Miscellaneous Topics / Dynamically produce a shatter pattern on: 2016-10-25 16:50:11
So over the past few weeks I've been working a lot on overlaying the shatter pattern you get from something like glass. Example:

Now you can mess around a lot with these types of images to produce nice effects in static imagery but I'd quite like to produce a more dynamic experience where you can see the shatter grow over time - I've experimented with expanding/shrinking the image and clipping it off with expanding circles but you can only do so much particularly with regards to directing the shatter.

With this in mind does anyone know of any material on procedurally generating similar patterns? It strikes me that it is a similar pattern to lighting or spider webs and I have definitely seen this generated.

Any ideas would be greatly appreciated. Thank you
5  Games Center / WIP games, tools & toy projects / Re: Praxis LIVE v2 - hybrid visual IDE for creative coding on: 2016-09-02 17:15:02
I'm working on a little project for a play I've got in the works and have a query.

I'm using the built in video:analysis:simple-tracker with a processed input stream like the examples and I'd like to use the blob info it generates and render on the original non-processed input stream but if you don't connect the output of the tracker it seems to just shut off. I presume an optimization because that channel isn't being used for anything. Now at the moment I'm just fading the two with a mix ratio of 99% so you essentially can only see the non-processed channel but just wondering if there is a better solution?

Also simply amazing program. Love it.
6  Discussions / General Discussions / Re: Comparison between 2 IDE's - Netbeans and Eclipse on: 2016-08-28 22:13:45
IDE choice tends to be a pretty subjective thing. Personally I'm so used to Netbeans that I use it for everything whether the IDE is designed for it or not. Plenty of plugins and then you get things like Praxis LIVE built on it which are really impressive.

As for LWJGL 2 vs 3, I'd go for 3 if I were you. You're probably thinking because there are tutorials for LWJGL 2 but frankly LWJGL3 is really simple. It even has a utility for loading natives which gets run automatically. So it's super simple.
7  Java Game APIs & Engines / OpenGL Development / Re: LWJGL instance in Javafx on: 2016-04-29 17:16:21
Take a look at this example:
8  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-04-09 13:58:13
Much appreciated as ever.

It's a very useful library btw. At first I tried to write in pure JS but then as ever the application got bigger than 3/4 files and JS began to become increasingly untenable so I thought to myself oh no I'm going to have to write the bridge between WebGL and GWT myself and it's going to be messy and horrible and then I remembered you posting about this and, as one of the most important marks of a good library, it just worked. So thank you.
9  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-04-06 20:00:00
Hey @SHC, I found another little bug.

glGetUniformLocation() is supposed to return a "-1" if the uniform doesn't exist in regular OpenGL. Obviously WebGL returns a "null" instead but the WebGLObjectMap maps a null to a zero. I suppose technically not a bug but I'm thinking undesirable behaviour?
10  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-03-30 21:11:00
Ah very good. Knew they existed for the extensions but just never thought to look on the core classes, sorry.
11  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-03-29 14:55:03
Amazing. Thanks so much. One last thing, not a bug this time I promise, a suggestion. I was updating my graphics driver the other day and once it installed it messed around with already open Chrome and long and the short I notice that the default behaviour for your library if it cannot get a WebGL context is to blast you with an alert saying you don't have WebGL which then takes you to the get WebGL website.

A lot of the time this is desirable behaviour but not always. For example WebGL might only be a section of the page and the other stuff is still useful even if the WebGL isn't working in which case it's pretty annoying if you keep getting redirected whenever you tried to load it up. Also redirecting with alerts like that can screw up the back button on some browsers I think (because you can't go back twice since you keep getting redirected). So perhaps A) include a function to test if WebGL is supported (also turns out you can test whether it is the browser not supporting WebGL or the hardware) and B) make the popup behaviour default but optional for the developer?

Anyway here is a quick function I wrote to test for WebGL support:
 * Returns null is WebGL is supported otherwise a String giving the reason why not.

private static native String isWebGLSupported() /*-{
    var canvas = $doc.createElement("canvas");
    var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
    if(gl && gl instanceof $wnd.WebGLRenderingContext) {
        return null;
    } else {
        if($wnd.WebGLRenderingContext ) {
            return "Hardware does not support WebGL";
        } else {
            return "Browser does not support WebGL";

I think there are a few reasons you might not be able to create a WebGL context if the browser supports it but I'm pretty sure I'm getting this from the WebGL spec on MDN so seems fairly legit. Also not 100% on the creating an offscreen canvas and canvas just to test for support but this is apparently the established method according to MDN again. Also if you incorporate this into the actual context creation then it's a non-problem.

Obviously just my penny's worth but what do you think?
12  Games Center / Showcase / Re: Cross Platform MMORPG: Little War Online on: 2016-03-29 14:37:03
Very pretty website but watch out cos there are a few typos. The ones I noticed:

The mission of the Draxian Paladin is to protect his foes
I presume that should be "protect his allies" unless I'm missing something.

These voracious spellcasters summon mystical minions to fight beside them and are experts sorcerer's
Should be "expert sorcerers"

they are the fastest and more agile warriors of the world
"and most agile"

So maybe it is worth a quick once over? Sorry to be picky it's just it really is a very pretty website but stuff like that just spoils things (certainly for me).
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-03-27 12:28:28
Thanks very much. I actually just found something else as well.

For glBufferSubData(), it's spec is,
void bufferSubData(enum target, long offset, Object data)

but WebGL4J has a prototype like the desktop GL version with a size parameter: "glBufferSubData(int target, int offset, long size, ArrayBufferView data)" which causes a crash when you try to use it "No function was found that matched the signature provided."
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-03-26 19:17:20
Hey @SHC
Just started using WebGL4J (literally few hours ago so might be missing something) but I think you're missing a function.

In WebGL there is a variant of glBufferData() which takes a long for initializing an empty buffer of a certain size.
void bufferData(enum target, long size, enum usage)

That's its definition on the WebGL quick reference card.

Anyway it certainly works for me using WebGL straight from JS but doesn't seem to exist in WebGL4J. Obviously easily worked around but just letting you know.
15  Game Development / Newbie & Debugging Questions / Re: Array Of Sub-Classes on: 2016-03-23 09:57:16

Note: this will get you some unchecked warnings

Protip: you can cheat Java into letting you create generic arrays without any ugly, unnecessary (from the pov of the programmer) casts or annoying warnings by using a generic, varags method.

public static <T> T[] genericArray(T... arr) {
    return arr;

use like this:

public static final Class<? extends GameItem>[] items = genericArray(

Java even infers the generic type when used like this so it's a very clean method. You can even create empty arrays of programmable lengths by using the Array.copyOf method as well:

public static <T> T[] genericArrayEmpty(int n, T... foo) {
    return Arrays.copyOf(foo, n);

Where "foo" is a dummy parameter. You can use it like this:

public static final Class<? extends GameItem>[] items2 = genericArrayEmpty(5);

Helps if you're a fan of pretty code.
16  Game Development / Newbie & Debugging Questions / Re: AABB collision detection as a filter for SAT collision detection on: 2016-01-27 10:35:40
This often a very good idea. As @Opiop says definitely benchmark and if there's no need for it, don't bother, but this is called the broadphase collision - with very broad, simple and indefinite collision tests and the narrow phase collision - with exacting collision tests which can be as complex as they need to be.
17  Game Development / Newbie & Debugging Questions / Re: Modern OpenGL & Shaders on: 2016-01-23 16:05:48
Also check out JOML for doing the maths. Don't use it myself but seems to be pretty popular and certainly has all the features you'll be needing. I believe it even has it's own matrix stack implementation.
18  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [libGDX] Is the LibGDX bullet binding standalone? on: 2016-01-12 19:09:13
I never bothered to isolate it because I don't really know the framework well enough but the basics were: whenever you tried to test the collision between a kinematic character controller and a static plane collision shape, a class cast exception was thrown. It's not a showstopping bug because obviously static planes don't appear too much in most games but I just felt it was worth seeing if it was actually necessary to use an old version of the library.
19  Game Development / Newbie & Debugging Questions / Re: [libgdx] trouble understanding orthocam and viewport on: 2016-01-12 10:48:14
So the best way to understand this is by looking at the camera analogy:
Click to Play

So the camera is all of the viewing (putting the camera in place), modeling (putting the objects in place) and projection (choosing the lens). The viewport is developing the picture (putting the image somewhere on the paper, the paper be analogous to the window).

So glViewport() only controls where in the window the stuff is rendered. Do not use it to control what is rendered. For most use cases, you should call glViewport() when the window is resized to make sure that you are rendering to the entire window.

I'm not sure what you mean by "a viewport that would be suitable for any resolution without the bars of glClear color" What bars is glClear presenting? If you mean to control the aspect ratio of a particular resolution, that should be taken care of in the camera.

For zooming, think about the camera analogy. To zoom in with a camera, you can either change the lens or you can move the camera closer. Same for OpenGL, change the projection or the viewing. What you cannot do is zoom by developing the photo differently.

Hope I've answered some questions.
20  Java Game APIs & Engines / Engines, Libraries and Tools / [libGDX] Is the LibGDX bullet binding standalone? on: 2015-12-28 14:20:22
Wondering whether LibGDX Bullet bindings can be used without the rest of LibGDX? This topic in the LWJGL forums (last post, last paragraph) suggest yes but I've just been trying and it seems to depend on the LibGDX math packages which are part of core LibGDX. Am I missing something or has the situation changed or is that just wrong.

I've been using JBullet previously but after encountering a pretty serious bug, I've decided using an older version is just untenable as well as being a bit silly.

21  Java Game APIs & Engines / OpenGL Development / Re: Netbeans GLSL editing mode? on: 2015-12-14 16:09:31
There are plugins but for older versions. For example a syntax highlighter:

But if I were you I'd just edit your shaders in something like Notepad++.
22  Game Development / Newbie & Debugging Questions / Re: Inertia tensor of aggregate mass on: 2015-11-15 12:48:35
It's that one thing which you never need again until suddenly you need it again.
23  Game Development / Newbie & Debugging Questions / Re: Inertia tensor of aggregate mass on: 2015-11-14 11:23:08
What you're looking for is the "Parallel Axis Theorem." It lets you sum various inertias (second moment thereof) and it's quite simple.

Essentially you can shift the second moment of inertia in one direction (let's say the x, y and z axes) to a new reference point. Once all second moments of inertia are all in relation to the same point, they can be summed together. (Pretty poor source of info unless you're at a far, far higher level of understanding of mechanics than me but even I was able to get the basics.)
24  Game Development / Newbie & Debugging Questions / Re: 3D Maths and OpenGL -- how and where do I get started? on: 2015-11-13 10:28:10
When it comes to vector maths in the context of game dev, my absolute favourite is
25  Discussions / General Discussions / Re: WIP Publication Reel on: 2015-09-25 18:29:04
The publication reel is just this sub-forum. If you want to talk to people about your in development game.
26  Game Development / Newbie & Debugging Questions / Re: jBullet compiling issue with JStackAlloc on: 2015-09-11 13:11:47
OK so it just started working. As far as I can tell, the only difference between today and yesterday is

A) My computer and the IDE (NetBeans) have been off and on again.
B) I've used JStackAlloc in another completely separate project.

I can only assume that one of these things have fixed the issue as I haven't touched the original project otherwise.
27  Game Development / Newbie & Debugging Questions / Re: jBullet compiling issue with JStackAlloc on: 2015-09-11 13:07:38
Tested out this theory just now by implementing my own little project testing out JStackAlloc. Took quite some figuring out the build script but managed to get it working allocating Vector3f and my own classes, both final and not. Only wish it could have been that simple.

28  Game Development / Newbie & Debugging Questions / Re: 2D - Smooth lighting with shadows for a tile-based game on: 2015-09-11 12:55:23
You might want to take a look at this tutorial. It isn't quite what you want but I think could easily be adapted., it isn't the easiest but would probably look the best in the end. (disclaimer: I've never actually implemented anything in this tutorial, just read it a while back out of interest).

If nothing else, give it a read and it'll give you an idea of how shadows are more commonly implemented.
29  Game Development / Newbie & Debugging Questions / jBullet compiling issue with JStackAlloc [SOLVED] on: 2015-09-10 19:59:41
So downloaded latest jBullet (Release 20101010) and I've been trying to get it to compile but I'm stuck on this error:

java.lang.IllegalStateException: first parameter of Stack.alloc(Class) must be constant (in class com.bulletphysics.collision.dispatch.ConvexConcaveCollisionAlgorithm, method processCollision)

It occurs during JStackAlloc's instrumentation phase of the compile, processing this snippet (I assume, that's the only calls to that method in the named method):

Now it seems to me that the first parameter IS constant and the instrumentation source code is a bit beyond my knowledge so I'm at something of a loss.

Thanks for any help you can give.

EDIT: The problem sort of resolved itself - see the 4th post for detail.
30  Game Development / Newbie & Debugging Questions / Re: Newbie Game Development Starting Point? on: 2015-09-03 16:07:21
Just to let you know, if you want to really start "from the bottom" then you do have to use an external library like LWJGL or JOGL and use OpenGL. That's the core graphics API that Swing is using under the hood.

Not saying you should, just letting you know.
Pages: [1] 2 3 ... 15
cybrmynd (27 views)
2017-08-02 12:28:51

cybrmynd (41 views)
2017-08-02 12:19:43

cybrmynd (54 views)
2017-08-02 12:18:09

Sralse (58 views)
2017-07-25 17:13:48

Archive (489 views)
2017-04-27 17:45:51

buddyBro (636 views)
2017-04-05 03:38:00

CopyableCougar4 (1117 views)
2017-03-24 15:39:42

theagentd (1126 views)
2017-03-24 15:32:08

Rule (1101 views)
2017-03-19 12:43:22

Rule (1078 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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!