Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 07, 2023 9:21 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Dec 12, 2017 2:49 am 

Joined: Sun Aug 27, 2017 1:41 am
Posts: 3
I'm trying to achieve a couple of basic visual effects in my game, and since shaders aren't supported in Slick (I wouldn't know how to make them anyway), I need help figuring out how to approach creating the visual effects that my game needs.

The first effect I need is a "flashlight". In the previous iteration of this game that was done in Swing/AWT in 2013, I created a completely black image with transparency, and then I would blend various shapes (radial gradients or polygons) into to subtract from the darkness and essentially create light, then draw it on top of everything.

So far, I have not seen an easy way of achieving this in Slick, but I have been more focused on the second problem, which is that I need to create a "night vision" effect, where I put a slightly transparent gray filter over everything, and then draw a white filter over the enemies so they appear like heat signatures, which would look like infrared night vision. The gray filter doesn't seem like it would be any more difficult than rendering a rectangle with the color (0.4f, 0.4f, 0.4f, 0.25f) or something similar. However, I have not been able to get a "white filter" over my images. Whenever I try to apply the color (1.0f, 1.0f, 1.0f) as a filter color in the g.drawImage() method, it simply draws the image as normal. I'm assuming this is because the color filter is simply a multiplication effect, leading it to just show the original color.

I have also tried drawing the image's "flash", then trying various draw modes and drawing the original image over it. The most promising was to color multiply the original image over the flash, but it was not white enough and made the transparent shadows under the enemies look strange.

Does anyone know of a way I can achieve this? I've been searching Google for two days now with no real helpful results. I know the Slick community isn't very active anymore, but I'm hoping someone out there can find a solution for me.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 12 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group