Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Possible means to speed up Bitmap TONE code?
#3
Kain "Man-o-Wolf" Nobel Wrote:First off; I suggest benchmarking to see if fill_rect is faster than set_pixel for a single pixel operation. I could be wrong but I think it is, oddly enough.

It makes you think so mainly because set_pixel "might" look for the color and then set it, while fill_rect would simply dump it all there. At the end it gotta be a slight advantage at most, yet, the benchmarking would make the difference. And a large picture gotta be use as a sample for that benchmarking!

Kain "Man-o-Wolf" Nobel Wrote:From what I understand, RMXP uses the Direct X standard. I believe it probably utilizes a primitive OpenGL standard too, and all operations are Shader operations, but I could be wrong or misunderstanding with how RMXP really works. Based on my limited understanding of the black box known as the RMXP hidden classes, plus what I've been doing with the RGL Core, I'm probably more right than wrong.

Sad Sadly, you gotta be wrong on this one. DirectX and any old fashioned OpenGL aren't that similar or compatible. If it were, all custom implementations of the RM series up to VX Ace would have been quite faster than they are. Hey! They'd even allow you to draw triangles like crazy. (They still could if Ojima ever cared about adding them, but the implementation would have been totally different from OpenGL's for sure.)

For instance, on Linux you NEED shaders to draw stuff on screen, even for a plain old sprite. Linux always relied on OpenGL for drawing operations before Vulkan came out. That's not necessarily the case on Windows.

Kain "Man-o-Wolf" Nobel Wrote:I doubt it iterates with a "for X / Y" block, I think it's all handled as a "pass through" operation using shaders. Same goes for Tone, Angle, Zoom, the operations of a Plane, etc.

For set_pixel method? I don't think they need a loop at all. Taking HiddenChest as an example, I'd venture to say the engine would simply calculate the real location of the pixels array and set the color directly. If Ojima followed that same train of thought at all...

The main problem that I can see between set_pixel and fill_rect is that for large areas, fill_rect is ideal. Heck, it just checks and convert the color from RGSS to C or C++ or C# once. set_pixel would have to do that conversion tons of times instead. And it IS a slow conversion.


One of the main reasons why set_pixel can get slow is because you can pass it 3 or 4 arguments at a given time. Ruby Ruby will treat it as a C Array that needs to be parsed internally one by one. Then it looks for the Color data wrapper after having done the same with the Bitmap wrapper...
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
RE: Possible means to speed up Bitmap TONE code? - by kyonides - 06-11-2023, 01:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Permanently modifying move speed Keeroh 5 8,703 05-24-2017, 05:47 AM
Last Post: DerVVulfman
   Meagan's Particles' speed Raou 6 8,381 04-01-2015, 03:43 PM
Last Post: Raou
   Custom Game_Event code lags too much! MechanicalPen 4 5,972 06-27-2013, 11:22 PM
Last Post: MechanicalPen
   Ruby, RGSS & General Code Discussion Kain Nobel 6 10,040 12-22-2012, 05:11 AM
Last Post: MechanicalPen
   Getting bitmap width and height of leading party member? PK8 5 7,745 08-27-2012, 11:41 AM
Last Post: Kain Nobel
   Pixelmovement and speed ark 2 5,083 05-31-2010, 05:51 PM
Last Post: ark
   VX Show Picture Event Command Code? PK8 2 5,895 02-27-2009, 11:30 PM
Last Post: PK8



Users browsing this thread: