Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (805)
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]
  ignore  |  Print  
  Billboard Sprite World  (Read 8695 times)
0 Members and 1 Guest are viewing this topic.
Offline ThaRemo
« Posted 2018-03-05 00:14:12 »

I've been working on and off on this project for the last couple of years. I wanted to make a world entirely out of billboard sprites. These are some recordings I made during the beginning of development in 2015:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

This was all rendered on a Swing JPanel, which was pretty inefficient. I've since switched to OpenGL, but at the time I didn't know any better.

Here are executable jar files of some versions if you're interested:
- First version:
- Improved version:
- Space version:

A couple of months later I was figuring out how to render a floor/ceiling grid and made some recordings. I've ended up not using it in the end since I moved on to full 3D movement later on.
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Almost a year later I decided to pick up this project again. I had a course on computer graphics and gained some knowledge of OpenGL, but I didn't know how to use it in Java up until this point. Then I discovered LWJGL and I was able to relatively easily migrate from a Swing Canvas to legacy OpenGL. The performance was still pretty terrible, so I started from scratch in modern OpenGL and it got pretty weird.
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Then I needed a faster way to choose which objects to render than checking them individually, so I implemented an octree data structure to render groups of nearby objects. A node is subdivided after a maximum amount of objects are added and it redistributes its objects to its 8 child nodes. It also allows for a fast way to raycast through all objects, which I used to detect collision with the player.
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

A few months ago I really got back into it and improved terrain generation using perlin noise and implemented some rendering optimizations.
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

And that's where I'm at right now Grin
Try the latest version here:
  • F to switch between orbit/first person camera.
  • In orbit mode: Middle mouse button to rotate, shift + middle mouse button to move around, scroll to zoom and click to focus on an object.
  • In first person mode: WASD to move, g to disable gravity, choose a sprite with number keys, left click to place, right click to remove, scroll to move cursor
  • F3 for viewing octree nodes, v to toggle vsync, b to toggle normal/additive blending

Offline Gjallar

JGO Knight

Medals: 48
Projects: 1

Follower of Nurgle

« Reply #1 - Posted 2018-03-05 00:32:33 »

I really appreciate that you documented your process, I find it very fun to see where it all started and how it progressed. Really interesting aesthetic! Who could have thought that a ton of billboards can look so nice.

Is this just a little thing to play around with for you, or are you actually gonna turn it into a game? If so, what's the plan?
Offline ThaRemo
« Reply #2 - Posted 2018-03-05 08:40:46 »

Thanks :D
At the moment I just kind of want to make cool looking landscapes and to populate the world with more things.
I've considered adding some rpg elements to make it more fun to explore, but it would take a lot of effort from where it is now. Maybe one day though...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline buddyBro
« Reply #3 - Posted 2018-03-05 16:10:41 »

It looks awesome! Did you make the textures yourself?
Offline ThaRemo
« Reply #4 - Posted 2018-03-05 16:36:47 »

Thanks! Yep, it's nothing fancy though. Here's the current sprite atlas:
Offline ral0r2
« Reply #5 - Posted 2018-03-06 15:20:05 »

Great job! Do you remember what tutorials you did use to start? (Assuming you used tutorials Cool
Offline ThaRemo
« Reply #6 - Posted 2018-03-06 18:59:24 »

Hmmm, I don't think I used tutorials. The only thing I knew how to do at the start was how to draw an image to the screen at a specific position.
The horizontal position of each object was calculated using the angle of the object relative to where the player is facing and the vertical position and scale depended only on the distance to the player.
But if you have any specific questions feel free to ask!
Offline ral0r2
« Reply #7 - Posted 2018-03-06 22:57:52 »

Thanks for info. But tbh I'm already struggling enough doing a 2D game. I can't imagine the effort a 3D game oder engine takes. Cheesy
Offline meva
« Reply #8 - Posted 2018-03-11 00:23:11 »

Your work is pretty impressive.

Did you think about writing a blog?
You can share more details about your work and progress.
Offline ThaRemo
« Reply #9 - Posted 2018-03-12 18:59:07 »

Thank you Smiley
Yeah, that might be fun. My progress is kinda slow but I'll try it sometime
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SolitudeGaming

Senior Devvie

Medals: 7
Projects: 2

« Reply #10 - Posted 2018-03-12 19:07:52 »

WordPress is a decent tool to use for blogging ^^ I use it.
Offline Shatterhand
« Reply #11 - Posted 2018-05-08 19:27:44 »

This looks quite interesting, a entirely new way of doing 3D graphics, though it would be kinda hard to add something like animated game objects (e.g. mobs). You would have to invent your own system for "billboard-sprite based animation in 3D" Smiley


Micro$oft broke Volkswagen's world record: Volkswagen only made 22 million bugs!
Offline ThaRemo
« Reply #12 - Posted 2018-08-15 19:43:59 »

<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Progress has halted recently, but I managed to implement some cool features a while back. I got inspiration and motivation from tutorials of the almighty ThinMatrix to implement  reflections on water and a coloured sky, which look awesome when combined at the end.
The reflections are accomplished by rendering the world a second time, but from the mirrored position and rotation of the camera to the water plane. The resulting image is used as a texture in the sprite shader and blends the appropriate part of that texture onto reflective sprites. The obvious limitation is that reflections only work on the water plane. An alternative would be to use screen space reflections, though those aren't as perfect.
The sky is just a quad that fills the entire screen. The colors are interpolated based on the camera orientation. Changing them over time would be quite easy since they're passed to the shader as uniforms.
Performance has also improved a bunch, since before every sprite was generated as a quad by a geometry shader. Now this is only done close to the camera, and sprites in the distance are rendered as actual point sprites, which is much faster but offers less control and has some limitations.
I've also added simple moving entities, which currently just move in a straight line, and implemented basic 3D audio support using OpenAL.

New controls: R to toggle reflections, middle-mouse-button to zoom in.
Runnable jar:

@Shatterhand Thanks! I've had some ideas about that, like in an entity creator GUI. It's at the top of my to-do list  Cheesy
Pages: [1]
  ignore  |  Print  

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

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

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

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

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

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

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

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

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

nelsongames (5123 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!