Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (775)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 70 71 [72] 73 74 ... 207
  ignore  |  Print  
  What I did today  (Read 2960679 times)
0 Members and 3 Guests are viewing this topic.
Offline theagentd
« Reply #2130 - Posted 2015-05-05 17:40:19 »

Did some nice thread profiling of WSW.

Without threading (off the charts!):


With threading:


Task details:

Red, green blue (x4 or x5) are physics updates. We do 250 updates per second to get good collision detection, so multiple ones are done for each frame rendered.
 - Red is the first threaded pass, where the position is updated based on velocity and then body-ground collisions are solved.
 - Green is the second pass where body-body collisions and body-triangle collisions are solved.
 - Blue is the third pass where body-ground collisions are solved again to eliminate any risk of falling through the ground (working on eliminating this).
 - Lastly, there's a fourth pass (white) which is so fast it's not visible. It's a single-threaded task which updates the body data structure in a thread-safe manner, but since it only processes bodies that actually need updating (checked in pass 4), it's almost instant.

The last tasks are for the rendering of the game.
 - Purple is actually part of the physics engine. It interpolates transforms for each body so the instance gets a properly interpolated matrix (allowing >250 FPS and reducing stutter at <250 FPS).
 - Then there's a gap, which comes from updating some rendering data (updating the animation frame of all 3D models, the camera) which is single-threaded in this threading program.
 - Yellow (single-threaded) is the light culling. It's fast so no real need to thread it.
 - Brown is 3D model "resetting" which prepares the 3D models for being culled by updating their bounding box. It also handles instance ID handling for SRAA.
 - Black is shadowed light matrix generation, which generates views for shadow maps to be rendered.
 - Reddish (single-threaded) is octree generation for model culling.
 - Light blue is terrain culling. It determines what terrain "tiles" are visible and constructs instance lists for each view (each light in that scene has 6 shadow maps which are also handled here).
 - Pinkish is model culling. Constructs instance lists for all views for 3D models.
 - Dark blue is terrain tile data packing in VBOs (an invisible green task maps the VBO after culling is done).
 - Red is model skeleton calculation and VBO uploading of instance data and visibility data for each view.
( - Last blue task is a rogue tile data packing subtask.)
 - Finally, the last black task (running on the top OpenGL thread) sends off all draw calls for the entire scene to the driver's internal thread.

There are some other tasks too but they are too fast/simple to mention (3 buffer mapping and 3 buffer unmapping tasks)

1 thread: 14 FPS
8 threads: 48 FPS (Fraps screwed up the FPS in the screenshot...)
= 3.43x scaling on a quad core with Hyper-threading. Quite good considering all the draw calls are single-threaded due to how OpenGL works and the driver only has 1 internal thread.

EDIT:
Realized that the skeleton calculation was way too slow. Turns out I was calculating skeletons for instances that eventually were prevented from being rendered due to being LODed out. Added an extra LOD check during culling and the FPS went to 25 with 1 thread and 82 with 8 threads, or 3.28x scaling. Scaling dropped due to a bigger percentage of the frame time being spent in single-threaded parts.

EDIT2:
Turns out I actually got GPU limited after the skeleton animation optimization at 8 threads. Reducing the resolution a bit under 1920x1080 gave me an FPS of 26 with 1 thread and 89 with 8 threads, which equals 3.42x scaling like before!

Myomyomyo.
Offline EgonOlsen
« Reply #2131 - Posted 2015-05-05 20:55:50 »

Finally added the last kind of enemy, an orc:


Offline NegativeZero

JGO Kernel


Medals: 333
Exp: 1 month or less


Zero but not.


« Reply #2132 - Posted 2015-05-06 06:05:04 »



Yet another wonderful ad on JGO.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
Administrator

« JGO Overlord »


Medals: 1356
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2133 - Posted 2015-05-06 12:12:12 »

Hm... all ads are configured to be "Safe for Work", I reported the ad to ProjectWonderful. Thanks for the heads up!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline ra4king

JGO Kernel


Medals: 508
Projects: 3
Exp: 5 years


I'm the King!


« Reply #2134 - Posted 2015-05-06 20:53:10 »

Got portals working!!

<a href="http://www.youtube.com/v/jCbQDq2ubPg?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/jCbQDq2ubPg?version=3&amp;hl=en_US&amp;start=</a>

Offline theagentd
« Reply #2135 - Posted 2015-05-07 12:56:14 »

Found a bug in my test program (not the engine) which switched around the LOD models, so the low-resolution models were being used up close and for distant instances the high-resolution models were used, cutting my FPS by 1/3rd... >___<

Myomyomyo.
Offline SHC
« Reply #2136 - Posted 2015-05-08 16:18:40 »

 Roll Eyes Achieved 150 days of GitHub streak today Shocked



My GitHub Profile if you're interested to see.  Pointing

Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #2137 - Posted 2015-05-08 21:03:09 »

Roll Eyes Achieved 150 days of GitHub streak today Shocked

*image*

My GitHub Profile if you're interested to see.  Pointing

Woah, that's cool. The most I've gotten is like 5 Tongue

[offtopic]
Nice (updated) profile pic
[/offtopic]

The darkest of carts.
Offline chrislo27
« Reply #2138 - Posted 2015-05-08 21:11:14 »

Roll Eyes Achieved 150 days of GitHub streak today Shocked

Congratulations! Now I don't feel guilty for only contributing one thing for the streak anymore  Tongue
Offline Opiop
« Reply #2139 - Posted 2015-05-08 22:30:32 »

Finally finished all my work for my internship interview, now I just have to await their decision! I'm currently relaxing and not even touching a computer... besides this one. Oops.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #2140 - Posted 2015-05-10 15:53:45 »

Discovered the Hough transform.
It's ingeniously simple, so I tried it out for line detection:



From left to right is the original image -> filtered to binary image -> a view of the hough space for the image -> the image with superimposed hough space mapped to cartesian -> detected lines

This uses the simpler y-intercept form over the Hesse normal form used in the wiki page.
Terrible, hastily-written code for the curious: http://pastebin.java-gaming.org/0e10964752f16
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #2141 - Posted 2015-05-10 17:48:27 »

Achieved this:


The darkest of carts.
Offline Elsealabs
« Reply #2142 - Posted 2015-05-11 21:42:49 »

Got some cool stuff working in XShot. Now I just have to get through the pain I am having with loading resources from the JAR where it works in Eclipse, but not as a JAR.

Here's a gif:
Click to Play

Offline Slyth2727
« Reply #2143 - Posted 2015-05-11 22:24:12 »

Got some cool stuff working in XShot. Now I just have to get through the pain I am having with loading resources from the JAR where it works in Eclipse, but not as a JAR.

Here's a gif:
Click to Play


Is this just for fun? Because puush does this and more. I'd happily switch to your program if you implemented better features though. But.. idk if hooking keyboard events is possible in Java. You could certainly try though.
Offline DarkCart

JGO Kernel


Medals: 124
Projects: 9
Exp: 50 years


It's all in the mind, y'know.


« Reply #2144 - Posted 2015-05-11 22:50:03 »

More wonderful ads?


The darkest of carts.
Offline Elsealabs
« Reply #2145 - Posted 2015-05-11 23:31:54 »

Is this just for fun? Because puush does this and more. I'd happily switch to your program if you implemented better features though. But.. idk if hooking keyboard events is possible in Java. You could certainly try though.

I am doing it for fun, but would also like it to be a viable product. Well, it's completely free, but you can get what I mean.

Hooking keyboard events is not possible in pure Java, but I've seen some libraries for Java out there that interface with native languages and provide that functionality. If you could message me on here with what features you would like to see, that would help tremendously. Or you could come talk to me on IRC at #java-gaming on freenode. There is a list of planned features on Github.

https://github.com/Elsealabs/XShot/wiki/Feature-List

Also, if you or anyone else is interested in contributing, that would also be great. Smiley

Offline Drenius
« Reply #2146 - Posted 2015-05-12 19:45:54 »

Finally put my current game on JGO...
Offline NegativeZero

JGO Kernel


Medals: 333
Exp: 1 month or less


Zero but not.


« Reply #2147 - Posted 2015-05-12 20:45:51 »

More wonderful ads?



@Riven, if they're becoming this frequent, perhaps a bad-ad centric topic is in order?
Spamming up WIDT is not very useful.

Offline DavidBVal
« Reply #2148 - Posted 2015-05-13 00:01:57 »

I've been painting little color rectangles, to properly debug collisions and attacks in my game (which incidentally, were a complete mess Tongue)


Offline Opiop
« Reply #2149 - Posted 2015-05-13 02:47:05 »

Finally got my internship! Backend programming for a huge ecommerce service, I'm really excited!
Offline matt_p
« Reply #2150 - Posted 2015-05-13 06:35:59 »

Fixed a nasty bug with the calculations of a level up - YAY, only took me 30 minutes to find and fix  Roll Eyes

Next 4 days are free for me -> more time for my project and I hope I will be ready to show it to you asap  Smiley
Offline hwinwuzhere
« Reply #2151 - Posted 2015-05-13 08:12:11 »

Actually this is more what I did yesterday, but I'm finally getting somewhere with lwjgl. Smiley



I can "walk" around with the camera, and rotate the camera left and right. I also implemented a z-order thingy, but it's not working exactly the way it should (yet).

It's all very basic, but I'm planning on actually finishing this for once Wink

There are two kinds of people in this world: Those who can extrapolate from incomplete data,
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2152 - Posted 2015-05-13 17:19:08 »

Started to play with voxels again, I've been out of touch with OpenGL tho, could anyone tell me what the smart way to do shadows is these days?



Cheers,

Kev

Offline theagentd
« Reply #2153 - Posted 2015-05-13 20:11:42 »

Shadow mapping.

Myomyomyo.
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2154 - Posted 2015-05-14 09:44:09 »

Is there some special form that gets me to a place where I can do shadows across a larger scene?

Kev

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 123
Projects: 15


★★★★★


« Reply #2155 - Posted 2015-05-14 10:23:35 »

Is there some special form that gets me to a place where I can do shadows across a larger scene?

Kev
Depending on how large your scenes are and your maximum depth buffer precision, you might be able to get away with just simple shadow mapping but for really large scenes typically the CSM or PSSM techniques have been used.

Most games also these days use some form of Ambient Occlusion (or approximation of it, like SSAO). Its an effect which really adds to the scene (especially for voxel style games). A relatively recent and popular algorithm seems to be Scalable Ambient Obscurance.
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2156 - Posted 2015-05-14 11:04:52 »

Thanks kappa.

Kev

Offline SilverTiger

JGO Coder


Medals: 41
Exp: 3 years


がんばってください!


« Reply #2157 - Posted 2015-05-15 20:43:29 »

Submitted the first draft of my bachelor thesis on the concept of a framework for teaching shader-based OpenGL Smiley

Offline CopyableCougar4
« Reply #2158 - Posted 2015-05-16 00:18:58 »

I've been bored in class, so I wrote a three-class serialization library. Easily reversible, but still cool.

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline theagentd
« Reply #2159 - Posted 2015-05-18 19:25:45 »

I rewrote the model renderer's octree since I had done some optimization on the physics engine's quadtree that I could carry over. Cut the culling cost of models by a lot and allowed for a few interesting optimizations. I also added proper threading for some trivial parts of the octree updating each frame, one of the few if not the only significant single-threaded part in the entire engine. I then tried to give threading the octree generation and basically hit a wall. With some clever rewriting to eliminate most synchronized() blocks, improved reuse of data between frames, and a few other tricks I might be able to get half-decent scaling out of it, but simply put it's always difficult or impossible to get good scaling when writing to the same place in memory using multiple cores. In the end I basically said "f*ck it" and simply went with the easiest solution: Multiple octrees! =D Instead of trying to stuff thousands of instances into the same octree, I simply divided up the instances and placed them in 2-4 separate octrees. Building two independent octrees has pretty much perfect scaling, so there's no problem there, but traversing 4 octrees with 1/4th as many instances in them is slower than 1 octree with all the instances... It's a simple solution that helped make the octree generation fast enough to run in parallel to better threaded tasks.

Myomyomyo.
Pages: 1 ... 70 71 [72] 73 74 ... 207
  ignore  |  Print  
 
 

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

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

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

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

nelsongames (1378 views)
2018-04-24 18:15:36

nelsongames (2001 views)
2018-04-24 18:14:32

ivj94 (2753 views)
2018-03-24 14:47:39

ivj94 (1955 views)
2018-03-24 14:46:31

ivj94 (3045 views)
2018-03-24 14:43:53

Solater (1090 views)
2018-03-17 05:04:08
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

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!