Render Samples and Problems

Posted by DFortun81 on Aug. 31, 2010, 2:45 a.m.

Okay so, if you ready my previous blog, I started on a new game project involving AI, UI, and other RPG things. Basically, it'll be an MMORPG of the sorts and I've run into a small dilemma: I've got some really nice looking frame and component rending going on, but it's really really taxing on the FPS. In order to fix this, I made a version using surfaces that update themselves only whenever the component of one of its children changes or needs to be redrawn. This brought the FPS back up to 60 and I was very happy with that, however, using the surfaces made the render look like complete shit!

Above: Original (non-surfaced) Render

Above: Surface Render
[hide=Same Render… but using GM Surfaces and Sir X's Fix.][img]http://64digits.com/users/DFortun81/Projects-CtA-RenderScreenshot_05.png[/img]

Above: Surface Render #2[/hide]

As you can see, the top version looks great! I want something like that, but with the FPS of the second image. (1) Is there a way to change the surface settings in GM to not fuck around with the opacity of the image in memory so much or (2) is there a different rendering DLL that you would recommend? I'm totally open to all suggestions at this point, I may even recycle this project into C++ since its still rather early in development.

(3) In that case, anyone recommend a good rendering method and tutorials on that subject if one can't be found?

(4) Oh, by the way, I'm using Game Maker 7. I don't know if they changed or added anything in regards to rendering in GM8, would that also be worth it?

Comments

DFortun81 13 years, 8 months ago

Note: Those four tool tips pull information off of the internet. It's not what I'm going for in the actual game.

blackhole 13 years, 8 months ago

Random guessing from a graphics programmer who doesn't actually know whats going on:

1. It looks like there is a resolution problem, which may be tricking you into thinking its rendering much faster.

2. This might be an off by 0.5 error, but seeing as this is GM that is highly unlikely.

3. There are alpha channel problems in the render

DFortun81 13 years, 8 months ago

It's rendering at the same dimensions. The surfaces just aren't drawing them as I expected them to.

sirxemic 13 years, 8 months ago

When drawing something transparent the alpha channel of the surface gets affected. This is a bug.

Solution:

after drawing everything onto the surface, do:

draw_set_blend_mode(bm_add);
draw_set_alpha(1);
draw_set_color(0);
draw_rectangle(0,0,surfacewidth,surfaceheight,false);
draw_set_blend_mode(bm_normal);

DFortun81 13 years, 8 months ago

[hide=Same Render… but using GM Surfaces and Sir X's Fix.][img]http://64digits.com/users/DFortun81/Projects-CtA-RenderScreenshot_03.png[/img]

Above: Surface Render #2[/hide]

That definitely made the text look better, but the component frame itself is getting overwritten by the fontstring surfaces now. :/

DFortun81 13 years, 8 months ago

Replacing "draw_set_blend_mode(bm_add);" with "draw_set_blend_mode_ext(bm_dest_alpha, bm_src_alpha);" fixed the problem.

sirxemic 13 years, 8 months ago

Hmmmmwut

DFortun81 13 years, 8 months ago

Problem Fixed! (Well, close enough.)

OL 13 years, 8 months ago

How are you doing the text outlines?

DFortun81 13 years, 8 months ago

Poorly. Essentially calling draw text with an alpha channel 8 times for the various pixel offsets. (+1, -1, etc)