PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

ClassEDisplay::SetShading with Surface blit flags

Hi, edge

I have realized that it is posible to use some Surface blit flags with SetShading in class EDisplay. For example EFX_ALPHA and EFX_COLORKEY.

I have tried EFX_COLORFILL but this one requires a parameter. It seems to work, because the render shows me a 3d object on black. I was wondering if it could be possible to change the color, because SetShading doesn't have an argument for this issue. Is there any way to do this?

Anyway I think that documentation of SetShading should talk about Surface blit flags and not only Render flags, because it is wonderful what you can do with these effects :)
Hi Zalo,

Great that you've discovered all the flag combinations. Please note that these blit flags only work for the internal renderer, when using OpenGL they don't work.

If you want to use the parameter (for example for a colorfill), it's better to render directly to the backbuffer. For example:

Code:

display->buffer.Render(0, 0, &model;, EFX_COLORIZE, ECOLOR_WHITE);
Hmmm... if I do as you say all world transformations are not taking in account. This must be because these transformatios are stored in the diplay and not in the buffer.

Why doesn't have SetShading an extra argument for the effects that may need them? As I said, it seems that these flags are working, but only with default values.
Hi Zalo,

That makes sense. The display->Render() and display->SetShading() methods where mainly designed to use for OpenGL, that's why it doesn't have the extra parameter.

This parameter will probably be added in a future release.