Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (814)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1] 2 3 ... 10
 on: 2017-09-26 20:51:12 
Started by philfrei - Last post by philfrei
Progress report:

Added two changes to AudioCue
  • has interface that allows it to be a "track" for an AudioCueMixer
  • added an alternate "Open" method where an AudioCueMixer is an argument.

Wanted to keep changes to API down. Above seems acceptable. Did some refactoring in the process to minimize code duplication between playing the AudioCue in its own thread vs. being part of mixer.

Two new objects that are part of the project:
  • AudioCueMixer (class)
  • AudioCueMixerTrack (interface)

Just finished round of debugging and ran a test on two AudioCue's being played via the mixer at the same time, and it worked fine. The cpu on the Windows Task Manager is staying below 0.5%, as it should.

Still some more work to do before publishing. I have to expand the API (write doc-comments) and other things like set up demo code and provide instructions.

I am second-guessing the name AudioCueMixer. The only thing that this class does, if you get down to it, is funnel all the audio to a single SourceDataLine output. There are no other standard mixing capabilities if you are looking at this as analogous to a DAW. All that has to be done via the constituent cue classes, as before. Also, I worry about confusion with the javax Mixer class (badly named imho).

It is possible to instantiate the AudioCueMixer with a buffer size and thread priority. The buffer size will be used to set the SourceDataLine buffer size, as well as impose this buffer size on the member AudioCueTracks. When no default is specified, I put in what I think is a rational default to override the really large default in the Java API. It seems more reasonable to make all the tracks use the same buffer size rather than trying to manage individual tracks having their own buffer sizes. If someone wants to have a different buffer for a given cue, they can run it independently or in a second AudioCueMixer.

AFAIK: while merging audio lines is helpful for situations with a limited number of outputs, I'm not at all clear that the doing merging at the Java level is any better than relying on the jre or native code provided that implements javax.sound.sampled.

Am also considering putting the project on GitHub. I kind of liked the idea that the code base was small enough that it could be easily loaded from a couple .java files, and GitHub tends to suggest more elaborate projects. With the AudioCueMixer added, we are now at 5 files (not counting demo & test code files). GitHub now has tools available which make it much easier to use than before, so that is an argument in its favor.

Blah blah keeping up my word count per post. This isn't exactly something I get to chat about with local friends and family exactly, nor with any 'employer', so hopefully some slack will be cut.

 on: 2017-09-26 18:39:46 
Started by Emmsii - Last post by Emmsii
I'm working on a small multiplayer game with Kryonet that would require a login with a username and password. I'm wondering what a safe way to handle this would be.

Obviously I won't be storing plain text passwords on the server database, most likely they will be encrypted with a salt (this article seems useful). If I let the server do the encryption it means I'm sending plain text passwords over the network. Would letting the client encrypt passwords be better? Are they any issues with this method?

 on: 2017-09-26 18:29:47 
Started by Ecumene - Last post by theagentd
A couple of tips:

 - The code you have is using samples distributed over a half sphere. Your best bet is a modified version of best candidate sampling over a half sphere, which would require some modification of the JOML code to get.

 - I'd ditch the rotation texture if I were you. Just generate a random angle using this snippet that everyone is using, then use that angle to create a rotation matrix around the normal (You can check the JOML source code on how to generate such a rotation matrix that rotates around a vector). You can then premultiply the matrix you already have with this rotation matrix, keeping the code in the sample loop the exact same.

 - To avoid processing the background, enable the depth test, set depth func to GL_LESS and draw your fullscreen SSAO quad at depth = 1.0. It is MUCH more efficient to cull pixels with the depth test than an if-statement in the shader. With an if-statement, the fragment shader has to be run for every single pixel, and if just one pixel in a workgroup enters the if-statement the entire workgroup has to run it. By using the depth test, the GPU can avoid running the fragment shader completely for pixels that the test fails for, and patch together full workgroups from the pixels that do pass the depth test. This massively improves the culling performance.

 - You can use smoothstep() to get a smoother depth range test of each sample at a rather small cost.

 - It seems like you're storing your normals in a GL_RGB8 texture, which means that you have to transform it from (0.0 - 1.0) to (-1.0 - +1.0). I recommend using a GL_RGB8_SNORM which can stores each value as a normalized signed byte, allowing you to write out the normal in the -1.0 to +1.0 range and sample it like that too. Not a huge deal of course, but gives you better precision and a little bit better performance.

 on: 2017-09-26 13:14:56 
Started by vfmachado - Last post by vfmachado
Thanks for the answer,

I'm updating the code to cascade shadow maps but I still with a problem to calculate the ortho matrixes.

I found this awesome example

But the code/framework is different of mine and when I update to this approach I got a problem, probably because ortho calculation isn't correct.

What I've tried is to put fix sizes of ortho projections and transforming it according to camera position, is that correct?

This is the problem that I'm getting ... running shadows just for red area.

 on: 2017-09-26 12:45:29 
Started by Ecumene - Last post by Ecumene
Your sample generation is indeed very odd. Why do you generate only vectors within the range ([0..1], [0..1], [0.5..1.5])?
And why do you weight/scale the vectors by i/1024?

As @theagentd suggested, you could use some sample pattern generators from JOML, such as "Best-Candidate" sampling, like so:

I followed this example to a tee, I'll be sure to fix my samples when I get home! Thank you so much for the help.

 on: 2017-09-26 12:28:54 
Started by SteveSmith - Last post by SteveSmith
I've just released the source to this if anyone is interested:-

 on: 2017-09-26 11:18:04 
Started by BurntPizza - Last post by CoDi^R
@CoDi^R: You say it like the Dark Side is a bad thing  Grin

Not at all! But as every Sith lord knows: it's a fine line between ruling the galaxy and going nuts.  Wink

 on: 2017-09-26 11:05:06 
Started by Ecumene - Last post by KaiHH
Your sample generation is indeed very odd. Why do you generate only vectors within the range ([0..1], [0..1], [0.5..1.5])?
And why do you weight/scale the vectors by i/1024?

As @theagentd suggested, you could use some sample pattern generators from JOML, such as "Best-Candidate" sampling, like so:
long seed = 12345L; // <- to seed the PRNG
int numSamples = 32; // <- number of samples to generate
int numCandidates = numSamples * 4; // <- increase this number to improve sample distribution quality
FloatBuffer fb = ByteBuffer.allocateDirect(numSamples * 3 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
new BestCandidateSampling.Sphere(seed, numSamples, numCandidates, (x, y, z) -> fb.put(x).put(y).put(z));

Here is an image of what that typically produces:

 on: 2017-09-26 11:02:52 
Started by BurntPizza - Last post by Oskuro
@CoDi^R: You say it like the Dark Side is a bad thing  Grin

 on: 2017-09-26 10:38:54 
Started by BurntPizza - Last post by h.pernpeintner
Interestingly most of the things Java really lacks are present in Ceylon. Which is looking veeeeeeeery interesting.

Cas Smiley

Yey, union and intersection types! Although I heard that this concept is one of those that worsen your codebase because modeling types is neglected piece for piece.

Pages: [1] 2 3 ... 10
theagentd (8 views)
2017-09-26 18:23:31

cybrmynd (139 views)
2017-08-02 12:28:51

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

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

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

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

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

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

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

Rule (1239 views)
2017-03-19 12:43:22
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!