Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (813)
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  
  2D Nuclear Throne style lighting [LibGDX]  (Read 1401 times)
0 Members and 1 Guest are viewing this topic.
Offline dime26

JGO Ninja


Medals: 49
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Posted 2017-07-13 21:50:10 »

Hello,

When it comes to graphic FX or shaders I am pretty clueless, I wanted to experiment with non Box2DLight lighting, something simple like this:



I found this code which seems pretty straight forward but it looks very inefficient, while it ran fine on my Windows PC which is a high spec it ran at around 30 FPS on my MacBook Air:

https://www.snip2code.com/Snippet/1027846/How-to-achieve-nuclear-throne-style-ligh

How might I achieve this, I am using LibGDX, making a game for PC (Windows/Mac)
Offline dime26

JGO Ninja


Medals: 49
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Reply #1 - Posted 2017-07-14 00:42:05 »

Playing about with Box2D shaders and other settings, could probably stick with this solution:



Offline orangepascal
« Reply #2 - Posted 2017-07-14 08:01:15 »

it's far simpler what they do (notice how it doesn't cast any shadows).

it's really blending alpha-transparent images on top of the rendered scene.

much like what I did with some of my games, and explained here (example uses libgdx, but it's really a few simple opengl blend+render calls):
http://techblog.orangepixel.net/2015/07/shine-a-light-on-it/

to get that "rough" look they have, make your alpha-blended images very rough like this:



the guy behind Orangepixel | twitter@orangepascal
http://www.orangepixel.net
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dime26

JGO Ninja


Medals: 49
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Reply #3 - Posted 2017-07-14 10:53:16 »

Thanks very much will have a play with that tonight as I think I prefer that look to box 2D Lights.
Offline dime26

JGO Ninja


Medals: 49
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Reply #4 - Posted 2017-07-14 22:59:56 »

Thanks for the tutorial, has given me more options with lighthing!

I made some changes to get it working, needs some refactoring but this is a great start, added a bit of shake to the example here while playing with ideas: https://gist.github.com/tyler6699/58a00ba6e679990984f8b090558ac3b4

Click to Play
Offline orangepascal
« Reply #5 - Posted 2017-07-16 11:33:06 »

good to see the tutorial helped Smiley

some results I have with it in my games:








test some things with the right ARGB values of a light, the size, and often I use a smaller light that's brigther in the center, and then a bigger light a little less bright around it for great effects

the guy behind Orangepixel | twitter@orangepascal
http://www.orangepixel.net
Offline dime26

JGO Ninja


Medals: 49
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Reply #6 - Posted 2017-07-19 22:15:48 »

Enjoy seeing all of your projects, some great screen shots there! I have followed the Robotability team and see they have some similar lighting which works so well. I will spend some time experimenting with this method and post some screen shots soon, really appreciate the help thanks for taking the time Cheesy
Offline orangepascal
« Reply #7 - Posted 2017-07-20 18:14:22 »

yeah the robotality guys actually told me how they did it, so I came up with this code which is basically the same Smiley

the guy behind Orangepixel | twitter@orangepascal
http://www.orangepixel.net
Offline Gornova
« Reply #8 - Posted 2017-07-20 18:54:53 »

If there is any running example for lights.. in my game are actually pretty bad Sad

Blog | Last game A droid story
Offline dime26

JGO Ninja


Medals: 49
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Reply #9 - Posted 2017-07-21 14:25:54 »

I will put a working example on Github later over the weekend.
Pages: [1]
  ignore  |  Print  
 
 

 
cybrmynd (136 views)
2017-08-02 12:28:51

cybrmynd (156 views)
2017-08-02 12:19:43

cybrmynd (149 views)
2017-08-02 12:18:09

Sralse (166 views)
2017-07-25 17:13:48

Archive (639 views)
2017-04-27 17:45:51

buddyBro (761 views)
2017-04-05 03:38:00

CopyableCougar4 (1293 views)
2017-03-24 15:39:42

theagentd (1261 views)
2017-03-24 15:32:08

Rule (1234 views)
2017-03-19 12:43:22

Rule (1309 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!