Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (594)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (646)
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]
1  Java Game APIs & Engines / OpenGL Development / Re: Tile based terrain lighting on: 2014-04-18 10:12:42
The shader code itself is actually pretty simple, it uses a standard 2-pass gaussian blur.

But applying this to the entire screen would destroy performance, as the blur radius needs to be very large for this to look good.

The trick is to render the transparent pixels as solid pixels to a screen sized FBO, then down-scale this FBO to a smaller FBO, say 1/16 the original size.

Apply the 2-pass gaussian blur to the down-scaled FBO, I used a 21-sample gaussian blur.

Then use linear sampling and up-scale this FBO to screen size, you will now have a nice smooth blurred version of the transparent pixels with a large blur radius at 16x less GPU cost.

blend this FBO with the texture being drawn, voila
2  Java Game APIs & Engines / OpenGL Development / Re: Per-pixel lighting (NO SHADERS!) on: 2014-04-17 21:02:32
I will echo the first two replies, just learn GLSL  Wink
3  Java Game APIs & Engines / OpenGL Development / Re: Tile based terrain lighting on: 2014-04-17 21:01:38
Hey peeps,

After much coding and research, I've finally come up with a very efficient algorithm for lighting, its shader based, and looks quite close to that of starbound:

Thanks for the suggestions everyone.
4  Java Game APIs & Engines / OpenGL Development / Re: Tile based terrain lighting on: 2014-04-01 13:42:07
Yes please, that'd be much appreciated
5  Java Game APIs & Engines / OpenGL Development / Re: Tile based terrain lighting on: 2014-03-30 14:05:16
I tried gaussian blur (standard 2-pass), but in order to achieve a blur as smooth with a high enough blur radius, I'd have to sample too many times, and again performance goes down the gutter....

The blur im using is similar, but achieved using less samples
6  Java Game APIs & Engines / OpenGL Development / Tile based terrain lighting on: 2014-03-30 12:03:02
Hi Guys,

So I've been trying to write a shader to light the terrain in my 2d tile based game, I'd like to achieve something that looks like Starbound's terrain lighting:

My attempts so far have not been so successful:

It's not as smooth as Starbound, plus it does not penetrate the ground as much.

My approach is something along the lines of:
Render transparent pixels to FBO, then apply some form of blur:

Blend this FBO with my foreground:

The performance isn't stella, ground penetration is low, the blur isn't smooth...

Does anyone have any pointers that could steer me towards a better solution?

7  Java Game APIs & Engines / Java 2D / Re: 2D terrain lighting similar to starbound on: 2014-03-30 11:51:39
Apologies if this was in the wrong forum, I have indeed misunderstood Java 2D to be a general 2D Java game dev forum Smiley
8  Java Game APIs & Engines / Java 2D / Re: 2D terrain lighting similar to starbound on: 2014-03-30 01:54:19
I have also implemented some shadow casting shaders:

However, im more interested in how to light the terrain (without needing a light source)
9  Java Game APIs & Engines / Java 2D / 2D terrain lighting similar to starbound on: 2014-03-30 01:23:17
So, I've been trying for a while to write something that achieves TERRAIN lighting similar to that of starbound:

But I'm not very good and the ones i manage to come up with are pretty inefficient and the framerate end up being rather poor using Java + openGL, shader based solutions.
Plus it doesn't look very smooth around the edges

My general approach has been:

Render transparent pixels to occlusion FBO
sample 8 times to achieve blur
render foreground blended with FBO


Could anyone shed some light on any alternative approaches?

Pages: [1]
Riven (22 views)
2015-07-03 11:22:16

deepthought (46 views)
2015-06-30 15:39:44

deepthought (49 views)
2015-06-30 15:39:09

deepthought (62 views)
2015-06-30 15:36:52

Za\'Anzabar (34 views)
2015-06-29 05:44:54

TritonDreyja (45 views)
2015-06-24 17:10:40

CopyableCougar4 (44 views)
2015-06-23 00:34:45

BurntPizza (48 views)
2015-06-21 20:36:46

cookiecompiler (91 views)
2015-06-11 15:42:53

cookiecompiler (54 views)
2015-06-11 15:41:14
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14 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!