Author Topic: sbw2  (Read 174776 times)

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #300 on: July 15, 2018, 02:33:48 PM »
hey frenchies i dont mean to nag but whats the best way to draw text with outline

currently im drawing the text 8 times behind the main text with a 1px offset in each direction but i cant help but feel that its a little unoptimal

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: sbw2
« Reply #301 on: July 15, 2018, 02:54:52 PM »
c = # of characters

its probably fine unless you have 1 million characters in your text. each character is just a rectangle aka 2 triangles. ideally the game maker text rendering uses a texture atlas so that should be decently cheap. likely the most expensive part of the operation (cpu-side) is generating the rectangles that the characters have to fill.

your method:
generates c*2*9 triangles
ideally requires 0 texture swaps
requires 0 buffer swaps

a good test is to try a really long string with your current system and see what happens. if performance is bad, you could try the following method:
  • render the text to a surface
  • render the surface to the screen with an offset and a color to give the text an outline
  • render surface to the screen to draw the text

this method:
generates (c+9)*2 triangles
probably requires 2 texture swaps (switch to surface, then back to game atlas)
requires 2 buffer swaps (switch to surface, then back to screen)

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #302 on: July 15, 2018, 03:55:30 PM »
ok but whats the best way of drawing a coloured "glow" around a sprite with alpha

should i just draw the sprite 8 times onto a surface then draw the surface with alpha or is there a better approach

if only i understood shaders

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: sbw2
« Reply #303 on: July 15, 2018, 04:01:25 PM »
again, this depends on how many you want to do in a single scene

if there are not many objects that need glow i would just draw some colored silhouette with alpha behind the sprite a bunch of times. if you want a bloom effect you should probably look at using a bloom post shader on your entire surface.

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #304 on: July 15, 2018, 04:02:55 PM »
like 5-8 at a time i guess

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: sbw2
« Reply #305 on: July 15, 2018, 04:07:59 PM »
thats not really a substantial amount so the naive approach should be fine

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #306 on: July 15, 2018, 04:10:23 PM »
ok thanks

aimaina

  • Administrator
  • Cutesterest
  • *****
  • Posts: 1320
  • Cutes: 211
    • View Profile
  • Pronouns: she/her
Re: sbw2
« Reply #307 on: July 15, 2018, 10:27:45 PM »
i generally use the "draw the thing eight times" approach for outlines except i usually just do it four times (no diagonal directions)

the game maker studio debugger has a "profiler" which tells you which parts of the code are taking up the most time each step, id suggest doing things the naive way most of the time and checking the profiler if you are worried about it. if it turns out your outlined text drawing is taking up 70% of the step or something then you can try to optimize it but in my experience its usually not a big deal to draw text 5 times instead of 1 time
~Without love, the truth cannot be seen~

this is watermelon :watermelon: put her in your signature so she can achieve world domination

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: sbw2
« Reply #308 on: November 25, 2018, 03:45:00 PM »
breaking New's: super bongus world 2 delayed to 2018 :dancedog:

super bong rip delayed to 2019

SquareWheel

  • Administrator
  • Cutester
  • *****
  • Posts: 802
  • Cutes: 139
    • View Profile
Re: sbw2
« Reply #309 on: November 25, 2018, 05:57:36 PM »
Callooh!  Callay!

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #310 on: November 25, 2018, 07:48:36 PM »
does bogus world 2 have a celeste minigame

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #311 on: November 25, 2018, 08:34:07 PM »
hey hubol how would you react if siivagunner made a craz'd rip

its not that far fetched since aus has two rips now and both games were made popular-ish by raocow

hubol

  • Cutesterest
  • ******
  • Posts: 1135
  • Cutes: 630
    • View Profile
    • hubolhubolhubol
Re: sbw2
« Reply #312 on: November 25, 2018, 10:45:27 PM »
goal for bogus is to make no platformers because im tired of them, so no celeste

however i did make a pogo platformer for it in 2014

i saw a couple craz’d and i think 2 rips but i dont know if they were by that person. anyway i would think it is funny, but i wouldnt consider the crazd pieces to be memorable, interesting, or catchy enough to do a rip

dcco

  • Cutest
  • ****
  • Posts: 469
  • Cutes: 112
    • View Profile
Re: sbw2
« Reply #313 on: November 26, 2018, 12:38:05 AM »
siivagunner is like an organization at this point right


also wuttttt there are untitled rips???? :O

wilde32

  • Cuter
  • ***
  • Posts: 237
  • Cutes: 24
    • View Profile
  • Pronouns: Consider replacing your battery.
Re: sbw2
« Reply #314 on: November 26, 2018, 01:39:28 AM »
i literally finished celeste today thats why i mentioned it. cute little game, but i dunno if i'll replay it to try to get 150 strawberries. i had around 120 when i got to the end.