Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 05:13:15 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Blend tiles inverted [Solved]
Pages: [1]
Print
Author Topic: Blend tiles inverted [Solved]  (Read 1365 times)
chegr
Level 0
***


Don't play baseball


View Profile WWW
« on: July 29, 2014, 06:34:48 AM »

I don't know exactly how to name it.

I want to achieve this look of my background (ignore shadows in arcs):


So I made this tileset:


But I have different colored backgrounds in every room
(you can see orange gets lighter and yellower to the bottom):


Background is a piece of gradient stretched and fixed to follow the current view.
If I just use tile_set_blend with a average background color, my tiles will be black+colored, and not white+colored.
I've tried to use draw_set_blend_mode_ext(bm_one, bm_inv_src_color); before drawing background, but in this case it should be drawn above tiles. I can't see how GML can manage that.
I could also use to have semitransparent tilse, but it's not possible, as far as I know.
I can also create tons of objects, but it's lame.

So what can I do? I don't want to have 6 different tilesets and I want to keep gradient.
Thank you in advance.
« Last Edit: July 29, 2014, 09:13:15 PM by chegr » Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #1 on: July 29, 2014, 07:58:15 AM »

i'm not sure what you are asking exactly because your english doesn't seem very good (?), but i'd suggest using additive blending, and making the tiles semi-transparent (go into gimp or photoshop, and do 'brightness to alpha', and import as png)
Logged

chegr
Level 0
***


Don't play baseball


View Profile WWW
« Reply #2 on: July 29, 2014, 04:31:40 PM »

your english doesn't seem very good
Yes, you are right, I'm Russian and I was frustrated last night when I wrote this post, so my English could be even worse. Sorry for this, I don't like when people write messy too. Feel free to correct me.
Thank you for you ideas!
I'm not sure about importing tiles with alpha.. I'll surely try, it would be the best solution.
The last time I checked it, GM refused to import these. I don't quite remember, it was several years ago.
About additive blending — do you know how to realize it in GM?
I also have thought about abandoning backgrounds and draw my gradient as stretched sprite.
Logged

Sik
Level 10
*****


View Profile WWW
« Reply #3 on: July 29, 2014, 05:19:06 PM »

I can see what's going on: you're multiplying the two colors, which results in black staying black, but white getting all the tint instead.

You could probably do this (note, didn't test, but should give you an idea):

  • Invert blend and texture colors
  • Multiply colors (blend)
  • Invert resulting color

Basically your problem is that you're just doing the second step there. By "invert" I mean getting the negative, by the way (e.g. black becomes white and viceversa)

EDIT: wait, GameMaker... er, yeah, no idea then. Probably the alpha idea is better (fill screen with the tint color then draw the tiles with alpha, though this means tiles can't overlap).
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #4 on: July 29, 2014, 05:47:51 PM »

gm imports images with alpha now. it didn't back with gm6, but that was over 5 years ago. current versions of gm -- gm7, 8, and studio -- all support alpha .png's
Logged

chegr
Level 0
***


Don't play baseball


View Profile WWW
« Reply #5 on: July 29, 2014, 09:11:30 PM »

Yep. Just checked. It not only allow to edit and load sprites with transparency (which I know), tiles can be also semitransparent (which is news). I was misguided by absence of function for applying mask to background.
Case is closed, thanks to everybody.
Logged

Thuby
Level 0
***



View Profile WWW
« Reply #6 on: September 21, 2014, 05:04:58 PM »

your english doesn't seem very good
Yes, you are right, I'm Russian and I was frustrated last night when I wrote this post, so my English could be even worse. Sorry for this, I don't like when people write messy too. Feel free to correct me.
Thank you for you ideas!
I'm not sure about importing tiles with alpha.. I'll surely try, it would be the best solution.
The last time I checked it, GM refused to import these. I don't quite remember, it was several years ago.
About additive blending — do you know how to realize it in GM?
I also have thought about abandoning backgrounds and draw my gradient as stretched sprite.

As soon as I read that you were russian I started to read in a russian accent. Facepalm
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic