Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
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:
http://flamingbard.files.wordpress.com/2013/12/starbound_mushrooms.jpg

My attempts so far have not been so successful:
http://i258.photobucket.com/albums/hh258/Plutoniummatt/Capture_zpsb146e4eb.png

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?

thanks.
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

Result:


Could anyone shed some light on any alternative approaches?



Thanks
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

PocketCrafter7 (14 views)
2014-11-28 16:25:35

PocketCrafter7 (9 views)
2014-11-28 16:25:09

PocketCrafter7 (10 views)
2014-11-28 16:24:29

toopeicgaming1999 (76 views)
2014-11-26 15:22:04

toopeicgaming1999 (67 views)
2014-11-26 15:20:36

toopeicgaming1999 (16 views)
2014-11-26 15:20:08

SHC (30 views)
2014-11-25 12:00:59

SHC (28 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (28 views)
2014-11-24 19:59:16
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!