Java-Gaming.org 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   
Pages: 1 ... 73 74 [75] 76 77 ... 216
  ignore  |  Print  
  What I did today  (Read 3665884 times)
0 Members and 2 Guests are viewing this topic.
Offline theagentd
« Reply #2220 - Posted 2015-05-28 19:50:38 »

Took another shot at anti-aliasing improvements today.

When using MSAA with deferred shading, it's pretty much mandatory to use some kind of system that only computes lighting and complex shaders on pixels that require it. At 8x MSAA, we're literally talking 8x the amount of lighting work, which would grind anything to a halt. Traditionally, this has been done by analyzing the depth and normals of the 8 samples of each pixel and determining if the pixel can be shaded once or if all 8 samples need to be shaded for correctness. This test leads to a stencil mask, and then lighting is done twice with two different shaders. The first pass only processes pixels that can be shaded once and the second one only processes pixels that need all 8 samples shaded. Branching in the shader to select per-pixel or per-sample shading generally leads to extremely bad performance and scheduling (one per-sample shaded pixel forces all neighboring pixels to run at per-sample resolution as well), and stencil test allows for much much better scheduling by the GPU. Newer compute shader based techniques like tile-based deferred shading work on a similar note, postponing all pixels that need per-sample shading to a second "pass" in the same compute shader.

My temporal SRAA implementation does not require per-sample shading; the scene is rendered as usual and the current and previous frames are used as input to the resolve shader. The resolve shader however is quite expensive. TSRAA works by matching an MSAA-resolution ID buffer to the shaded color samples of the previous and current frame to reconstruct an MSAA-resolution shaded image. 8x TSRAA essentially gives us 2x temporally supersampled shading with 0 risk of ghosting and 8x MSAA edge quality, while still only requiring a per-pixel shaded scene. The thing is that the upsampling process involves checking the neighboring shaded pixels as well in an attempt to find color data for each MSAA ID sample. This means checking the center pixel and the 4 closest pixels for both the current and previous frame, e.g. 8 ID samples are matched against 10 color samples. In addition, 10 transparency samples need to be taken and overlayed on top of each color sample, and finally there's a motion vector being sampled for temporal reprojection to the previous frame. All in all, the shader does a total of 29 texture samples and a large amount of ALU operations. At 2560x1440 and 8x TSRAA, this resolve pass took ~4.2ms, over 1/4th of the entire frame budget.

Since the resolve pass is so expensive, I looked for ways of reducing the cost of it. I observed that probably 95% of all pixels are trivial to resolve. If all 8 ID samples are identical, we are pretty much guaranteed to have a color sample for all IDs in the center pixel of the current frame, and possibly in the previous frame as well, but this is not guaranteed. The center samples are prioritized, so if a center pixel match is found the neighboring pixels aren't used. I decided to try to generate a stencil mask to find the pixels were all samples had identical IDs and process them with an optimized much faster shader. The optimized shader only samples the current and previous center pixels, the transparency data of those two pixels and the motion vector for reprojection, e.g. only 5 texture samples instead of 29. Ghosting is prevented by checking if the previous frame has the same ID as the current frame. A few minutes of playing with Shader Analyzer gives the following stats:

 - Full resolve shader: 705 instructions, 29 texture samples, 37 registers, 1.19 pixels/clock, slightly ALU limited
 - Fast resolve shader: 47 instructions, 5 texture samples, 5 registers, 9.6 pixels/clock, heavily texture limited




Red pixels are pixels that had the expensive resolve shader run. Imgur murdered the quality though... q.q


Now, for this scheme to be faster, the combined cost of running the stencil mark pass, the fast resolve pass and the full resolve pass needs to be lower than the cost of simply running the full resolve shader on the whole screen. Performance results woooh!

Before:
Quote
               engine.post.ResolveProcessor2 : 5.031ms
                    Generate DMV buffer : 0.11ms
                    Pack depth and motion vector lengths : 0.228ms
                    Pack transparency : 0.69ms
                    Full resolve pass : 3.998ms

After:
Quote
               engine.post.ResolveProcessor2 : 3.73ms
                    Generate DMV buffer : 0.094ms
                    Pack depth and motion vector lengths : 0.224ms
                    Pack transparency : 0.695ms
                    Stencil mark : 0.544ms
                    Fast resolve pass : 0.689ms
                    Full resolve pass : 1.477ms

The time of the resolve pass went from ~4.0 ms to a combined cost of ~2.7 ms. The performance gain depends on the scene of course, but this was a fairly "noisy" scene with lots of pixels that required the full resolve pass. In many scenes, the sky will take up a large part of the screen, and those pixels become extremely cheap. More often than not, the full resolve pass drops to under 1ms. I have yet to find a scene that actually became more expensive due to the overhead of the stencil marking etc, so I will go with it permanently.

Myomyomyo.
Offline Zeldar
« Reply #2221 - Posted 2015-05-28 20:08:21 »

Finished a spell in my game, it took like 10 mins of coding and 5 hours of art work including sound but it was worth it  Grin <a href="http://www.youtube.com/v/uvQJRJ8f52Q?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/uvQJRJ8f52Q?version=3&amp;hl=en_US&amp;start=</a>
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #2222 - Posted 2015-05-28 20:45:40 »

I realized that I love messing about with graphics code, but the progress is very slow and it stops me getting anywhere. So I have gone into antigraphics mode, and am using good old Java 2D now. I am trying to be as ungraphical as possible for the next 6 months.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Opiop
« Reply #2223 - Posted 2015-05-28 21:08:45 »

At work this morning I took an hour and taught myself the basics of ASP.NET MVC with C# and Bootstrap, and then I spend the remainder of my day throwing up the UI for my web application. C# is such a fun language to work with, I actually like it as much, or maybe even more, as I like Java. And ASP.NET MVC is an amazing tool to quickly design and implement a front end application. Unfortunately, my boss is requiring me to code the backend in Java still which complicates things. IMO, it would be far easier just to do the entire backend in C# and not mix and match languages. But whatever boss wants, he gets so long as I get my paycheck and comfy chair Wink
Offline thedanisaur

JGO Knight


Medals: 59



« Reply #2224 - Posted 2015-05-29 15:53:45 »

I got a job a couple weeks ago and decided to go back to school so progress has been slow, but this morning I "finished" animation blending. It started with blending the current frame with the next frame in the animation so when it plays at a slower speed I still get a smooth animation and when faster it doesn't skip frames. Then I used the same process to blend two animations together. In the future I will be able to blend multiple animations together with out any problems, but for now I think two is fine.

I'm now running into an issue that when the animation loops it slows down for a few frames and then speeds back up. Not sure if it's because I'm bad at animating or because I have a problem in my code.

Every village needs an idiot Cool
Offline Herjan
« Reply #2225 - Posted 2015-05-29 21:16:04 »

Played around with Perlin Noise for the first time to generate 'sky'. (Yes the landscape is a bunch of Math.randoms)
The following images may look better when you click on them.

Two types of space:


No doubts, this one looks craz... very abstract


Yes this one has sharp contrast with the landscape

Earthplay:


Offline nsigma
« Reply #2226 - Posted 2015-05-30 15:35:49 »

Well, today a boring and hot journey back from London ...

Yesterday OTOH, got to talk about Praxis LIVE (website / forum thread) at NetBeans Day UK.  Grin



Pleased that people were impressed by things like live code editing / injection of Java & GLSL code.
Bemused that people were impressed by 60fps OpenGL - it's 2015!  Emo - do we all need to get out and shout about what we do more?
Grateful how much this community has helped me become someone who can talk to a bunch of top-notch Java developers!  Cool

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline teletubo
Global Moderator

JGO Wizard


Medals: 76
Projects: 4
Exp: 8 years



« Reply #2227 - Posted 2015-05-31 04:33:58 »

Hmm, it's a Google AdSense ad, so I cannot report it to ProjectWonderful, as is. Emo

The previously reported (by you) ads have been reported (by me) to ProjectWonderful and those advertisers have been banned/punished/murdered in quick succession, as per my request.

I probably missed a part of the conversation. but what exactly is the problem with those ads? it looks legit. The only not legit  thing about it maybe is the girl's butt. And maybe some people here do want to get a girlfriend ... so it's a well targeted ad.

Offline Gibbo3771

JGO Kernel


Medals: 128
Projects: 5
Exp: 1 year


Currently inactive on forums :(


« Reply #2228 - Posted 2015-05-31 07:08:28 »

Hmm, it's a Google AdSense ad, so I cannot report it to ProjectWonderful, as is. Emo

The previously reported (by you) ads have been reported (by me) to ProjectWonderful and those advertisers have been banned/punished/murdered in quick succession, as per my request.

I probably missed a part of the conversation. but what exactly is the problem with those ads? it looks legit. The only not legit  thing about it maybe is the girl's butt. And maybe some people here do want to get a girlfriend ... so it's a well targeted ad.

Mostly to do with this being a family friendly website, face it, click that ad and see it's just a website for swingers . You don't see these ads on other forms.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline Riven
Administrator

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2229 - Posted 2015-05-31 09:25:28 »

I only allow 'safe for children' ads on JGO, and these were a bit inappropriate for that category.

Anyway, the AdSense ads have been pulled, so all is fine for now. There are 'misrated' ads on ProjectWonderful too, but these I can report/pull individually - so keep me informed.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SHC
« Reply #2230 - Posted 2015-05-31 09:39:34 »

Tried rendering the floors of Hell.



400 blocks rendering at ~640 FPS without any sort of culling. Should I worry about performance now?

Offline ra4king

JGO Kernel


Medals: 508
Projects: 3
Exp: 5 years


I'm the King!


« Reply #2231 - Posted 2015-05-31 10:32:05 »

Only 400? Try a few hundred thousand Grin

Offline SHC
« Reply #2232 - Posted 2015-05-31 10:38:22 »

Only 400? Try a few hundred thousand Grin

Tried that. 8000 cubes are rendering at ~100 FPS.

Offline death_angel
« Reply #2233 - Posted 2015-05-31 10:45:42 »

So this is how my school project looks like:



Today is time to start porting it to android  Smiley

I am just a guy
Offline chrislo27
« Reply #2234 - Posted 2015-05-31 17:05:41 »

I skimmed through Microsoft's documentation on C# for Java developers. It didn't look too bad, some good things were that it had signed and unsigned numbers (as primitives rather than using a method to do addition for "unsigned" numeric values), operator overloading, indexers, blah blah blah... Some things that will take way too long to get used to are the stupid UpperCamelCaseEverythingIncludingMethodsAndVariables.

That might nearly deter me from actually venturing into C#. Oh well...
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #2235 - Posted 2015-05-31 17:12:07 »

I'd say a language is doing pretty well if the biggest problem you have with it is syntax convention.
Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #2236 - Posted 2015-05-31 17:21:28 »


This will come in handy Grin

Hey, you! Back to work
Offline Opiop
« Reply #2237 - Posted 2015-05-31 17:51:35 »

On Friday at work I managed to connect the front end and the backend of my web application together, and I switched from using a SOAP based web service to REST with Spring Boot. Saved my life. I had my web service back up and running in under half an hour, whereas the SOAP version took me hours to even get a functioning version. Also switched over to a Gradle build system which makes dependencies and building a WAR file for my Tomcat server ridiculously easy. The great thing about Spring Boot is I have the option to create a runnable jar with a Tomcat server embedded in it, so I can just run the jar from the command line and boom, web service up and running OR I can build a WAR file and throw it into my external Tomcat instance. Having the runnable jar makes debugging very easy though, because I don't have to remember to restart my Tomcat server every time I need to test my new build.

I have practically finished the layout of the front end, although I want to simplify the interface a little more. Right before I left work on Friday I also managed to connect to our SQL database and display a record on my website! Really cool stuff, I was happy to finally be able to connect to the database. I'm excited to go into work on Monday!
Offline MrPizzaCake

Senior Devvie


Medals: 8
Exp: 3 years


Hello, another wonderful human being :)


« Reply #2238 - Posted 2015-05-31 18:53:18 »

Welp, after a few month break, I'm back in the programming... thing. Woohoo!

How am I? Tough question, since emotions are confusing as heck Tongue
Offline theagentd
« Reply #2239 - Posted 2015-06-01 02:07:12 »

Did even more work on my anti-aliasing resolve system.

I started out with a simple brute-force algorithm. Doing everything in a single shader pass lead to a pretty slow shader as the shader ended up being over 1000 instructions long and over 50 texture samples read from 10 different textures. When profiling, the whole thing simply looked like this:
Quote
                    Resolve pass : 3.403ms
3.4 ms, and that's only at 1920x1080. Quite expensive. To improve the quality of transparent geometry being overlaid on edges, I precomputed a transparency buffer for both the current and previous frame to be overlaid on top of them. At the same time, I could move out motion blur, the second biggest part of the shader, to the precomputation pass. Not only did this improve quality a lot, it also improved performance as the shader got split up into two parts, and the precomputation pass also saved some work in the resolve shader.
Quote
                    Pack transparency : 0.417ms
                    Full resolve pass : 2.406ms
That shaved off 0.6 ms and we end up at around 2.8 ms. Still a bit high. As I wrote in my last post, I realized that most pixels were trivial to resolve, and by computing a stencil mask I could improve my code to only compute the expensive resolving for the pixels that needed it. The rest used a simpler much faster shader that gave identical result for those trivial cases.
Quote
                    Pack transparency : 0.412ms
                    Fast resolve pass : 0.362ms
                    Stencil mark : 0.321ms
                    Full resolve pass : 0.783ms
That got rid of a lot of work! We're down another 0.9 ms, to 1.9 ms.

My new system precomputed the transparent geometry to overlay on each current and previous frame pixel, but this had the problem that since the resolve shader read a total of 10 pixels, I ended up with 10 color samples and 10 transparency samples, and also extra instructions to blend the transparent geometry with the color samples. I realized that it was actually possible to do the reprojection and blending completely during the precomputation, which meant that I could get rid of the 10 transparency reads from full resolve shader as well as a handful of ALU instructions. Although this increased performance a bit, the shader actually just became extremely ALU limited instead, so the performance increase wasn't as big as I had hoped. In addition, I managed to do some minor optimizations in the full resolve pass which saved a few ALU instructions. The precomputation also helped the fast resolve pass a bit as well, as it now only has to do 3 texture samples and a small handful of instructions, so it's actually ROP (fillrate) limited now due to how cheap it is.
Quote
                    Pack transparency : 0.515ms
                    Fast resolve pass : 0.254ms
                    Stencil mark : 0.322ms
                    Full resolve pass : 0.492ms
The wrongly named transparency packing (e.g. the complete precomputation pass, to be renamed) went up by 0.1 ms, but the fast resolve pass shaved off 0.1 ms too. The full resolve pass also got quite a bit faster, losing almost 0.3 ms too. All in all, we're down to just under 1.6 ms, a pretty amazing result considering the same process took 3.4 ms a few days ago.

Myomyomyo.
Offline SkyAphid
« Reply #2240 - Posted 2015-06-01 06:34:47 »


I've spent some free time tonight working on the boss AI for the main rival in the game.

Mostly fixing some bugs. There were some bugs that caused sound spamming, and others that caused his spear to rotate strangely. Turned out to all be typos that took forever to find. Don't you just love that?

I also did some GUI work to make it looks cleaner and make sure that elements that required your attention flashed appropriately to get that attention.

Not nearly as cool as the stuff agentd did and I don't have any cool numbers for you, but I can say that my AI is hyper lethal AND stable.

it just werks
Offline ClaasJG

JGO Coder


Medals: 43



« Reply #2241 - Posted 2015-06-01 10:16:59 »

I made a school group project yesterday and presented it today.

https://bitbucket.org/ClaasJG/hopfield/downloads/Hopfield.jar

It is a small program that recognises patters via a Hopfield net. Simply edit patters with the context menu in the pattern view (right).

-ClaasJG

My english has to be tweaked. Please show me my mistakes.
Offline pitbuller
« Reply #2242 - Posted 2015-06-01 19:49:07 »

...
Quote
                    Pack transparency : 0.515ms
                    Fast resolve pass : 0.254ms
                    Stencil mark : 0.322ms
                    Full resolve pass : 0.492ms
The wrongly named transparency packing (e.g. the complete precomputation pass, to be renamed) went up by 0.1 ms, but the fast resolve pass shaved off 0.1 ms too. The full resolve pass also got quite a bit faster, losing almost 0.3 ms too. All in all, we're down to just under 1.6 ms, a pretty amazing result considering the same process took 3.4 ms a few days ago.

With those precomputation optimizations is the fast resolve pass + stencil markin still a win?
Offline theagentd
« Reply #2243 - Posted 2015-06-02 02:50:08 »

...
Quote
                   Pack transparency : 0.515ms
                    Fast resolve pass : 0.254ms
                    Stencil mark : 0.322ms
                    Full resolve pass : 0.492ms
The wrongly named transparency packing (e.g. the complete precomputation pass, to be renamed) went up by 0.1 ms, but the fast resolve pass shaved off 0.1 ms too. The full resolve pass also got quite a bit faster, losing almost 0.3 ms too. All in all, we're down to just under 1.6 ms, a pretty amazing result considering the same process took 3.4 ms a few days ago.

With those precomputation optimizations is the fast resolve pass + stencil markin still a win?
Yes. When only doing 2xTSRAA both with and without stencil testing the performance is the same. I'm considering disabling the stencil mask in that specific case. For 4x, 8x and 16x, the stencil mask is a huge win as the fast resolve shader is equally fast regardless of sample count while the full resolve shader explodes.

I will double check my results tomorrow and compare it more extensively.

Myomyomyo.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #2244 - Posted 2015-06-02 06:32:28 »

I lost my USB today which has all my code on it (I prefer USB rather to cloud just incase I ever need to go out and about with my laptop or another computer). I have a bad habit of not keeping up to date with my backups. Luckily, the most recent one is only last week. So yeah, not much...

Is it sad that I still get a fright when the computer beeps at me...
Offline Opiop
« Reply #2245 - Posted 2015-06-02 13:01:53 »

I lost my USB today which has all my code on it (I prefer USB rather to cloud just incase I ever need to go out and about with my laptop or another computer). I have a bad habit of not keeping up to date with my backups. Luckily, the most recent one is only last week. So yeah, not much...
What I would recommend is backing up to the cloud as well as having your backups on your USB drive. It'll solve situations like what you're in now, and source control isn't very hard to use, especially when you're the only one pushing changes.
Offline Slyth2727
« Reply #2246 - Posted 2015-06-02 14:35:54 »

I lost my USB today which has all my code on it (I prefer USB rather to cloud just incase I ever need to go out and about with my laptop or another computer). I have a bad habit of not keeping up to date with my backups. Luckily, the most recent one is only last week. So yeah, not much...
What I would recommend is backing up to the cloud as well as having your backups on your USB drive. It'll solve situations like what you're in now, and source control isn't very hard to use, especially when you're the only one pushing changes.

I agree... I made the same mistake of not backing it up online once. Never again.
http://www.java-gaming.org/topics/crash-corrupt-file-months-of-work-lost/35787/msg/339315/view.html
Offline theagentd
« Reply #2247 - Posted 2015-06-02 15:58:32 »

Had my last exam! FREEDOM FOR 3 MONTHS!!!

Myomyomyo.
Offline SHC
« Reply #2248 - Posted 2015-06-02 16:09:54 »

Had my last exam! FREEDOM FOR 3 MONTHS!!!

Right now, I'm in the same freedom (1 more month for the classes to start) and I'm really waiting for the college to start. Holidays are boring!

Offline SauronWatchesYou

JGO Ninja


Medals: 33
Projects: 4
Exp: 2 years


Hi there! :)


« Reply #2249 - Posted 2015-06-02 16:12:38 »

Today I've been learning some Javascript so I can build a personal website from scratch Grin

I'm also on holiday at the moment! Currently 1 month in, I don't start University until very late September.. help me

Hey, you! Back to work
Pages: 1 ... 73 74 [75] 76 77 ... 216
  ignore  |  Print  
 
 

 
Riven (579 views)
2019-09-04 15:33:17

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

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

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

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

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

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

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

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

nelsongames (5114 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
java-gaming.org 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‑gaming.org
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!