BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Reproducing the demo outline circle in the screen editor  (Read 7538 times)

obones

  • Newbie
  • *
  • Posts: 9
    • View Profile
Reproducing the demo outline circle in the screen editor
« on: September 02, 2021, 02:45:09 PM »

In the SampleApp, there is set_07 that displays only the outline of a circle by means of multiple points drawn with different blending functions.

I'm now trying to use this kind of effect in my own system and it does not work at all, nothing is displayed.

I thus went to the EVE Screen Editor application and tried to reproduce ConcentricCircles from set_07 with the following coprocessor list:


CMD_DLSTART()
VERTEX_FORMAT(0)
CLEAR_COLOR_RGB(255, 255, 255)
CLEAR(1, 1, 1)

BEGIN(LINES)
LINE_WIDTH(16)
COLOR_RGB(0x0, 0xFF, 0xFF)
VERTEX2F(200, 200)
VERTEX2F(400, 400)
END()

CLEAR_COLOR_A(0)

BEGIN(POINTS)

COLOR_MASK(0, 0, 0, 1)
BLEND_FUNC(ONE, ONE_MINUS_SRC_ALPHA)

POINT_SIZE(1600)
VERTEX2F(300,300)

BLEND_FUNC(ZERO, ONE_MINUS_SRC_ALPHA)

POINT_SIZE(1400)
VERTEX2F(300, 300)

COLOR_MASK(1, 1, 1, 0)
BLEND_FUNC(DST_ALPHA, ONE)

COLOR_RGB(0, 255, 0)
POINT_SIZE(1800)
VERTEX2F(300, 300)

BLEND_FUNC(SRC_ALPHA, ONE_MINUS_SRC_ALPHA)

END()


I was expecting this to give me a diagonal blue line with a green circle outline drawn on top of it.
But all I get is the blue line, nothing else.

What have I missed?
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: Reproducing the demo outline circle in the screen editor
« Reply #1 on: September 03, 2021, 04:54:04 PM »

Hello,

Thank you for your question, would you be able to provide an example of what you are trying to draw on the screen for reference?

Best Regards,
BRT Community
Logged

obones

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Reproducing the demo outline circle in the screen editor
« Reply #2 on: September 06, 2021, 01:36:00 PM »

Hello,

In the demo, there is this rendering:



I'm trying to replicate it, to get a green circle outline on top of a blue line, like this:



But with the given set of commands, all I'm getting is the line by itself:



Clearly, I have missed something, but I can't figure out what.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: Reproducing the demo outline circle in the screen editor
« Reply #3 on: September 06, 2021, 04:45:58 PM »

Hello,

The following code will draw the desired circle with the line through it,

Code: [Select]
BEGIN(LINES)
LINE_WIDTH(48)
COLOR_RGB(0x0, 0xFF, 0xFF)
VERTEX2F(1688, 1384)
VERTEX2F(4768, 5056)
END()

BEGIN(POINTS)


CLEAR_COLOR_A(0)
COLOR_MASK(0, 0, 0, 1)

BLEND_FUNC(ONE, ONE_MINUS_SRC_ALPHA)
POINT_SIZE(1600)
VERTEX2F(3200, 3200)

BLEND_FUNC(ZERO, ONE_MINUS_SRC_ALPHA)
POINT_SIZE(1520)
VERTEX2F(3200, 3200)

COLOR_MASK(1, 1, 1, 0)

BLEND_FUNC(DST_ALPHA, ONE)
COLOR_RGB(3, 182, 0)
POINT_SIZE(1600)
VERTEX2F(3200, 3200)
BLEND_FUNC(SRC_ALPHA, ONE_MINUS_SRC_ALPHA)

END()

However after some investigation it appears as if the CLEAR_COLOR_RGB command is causing the behaviour you are seeing where the circle isn't being drawn. For example if you alter this to black or red the circle is drawn correctly. I believe this sample was designed only to utilise a black background, but I will confirm this with the development team, and in the meantime investigate a solution to this issue.

Best Regards,
BRT Community
Logged

Domdom

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Reproducing the demo outline circle in the screen editor
« Reply #4 on: November 05, 2021, 01:25:42 PM »

We can use STENCIL to draw that

Code: [Select]
EVE_Cmd_wr32(s_pHalContext, BEGIN(LINES));
    EVE_Cmd_wr32(s_pHalContext, COLOR_RGB(0, 0, 255));
    EVE_Cmd_wr32(s_pHalContext, LINE_WIDTH(10)); //inner circle
    EVE_Cmd_wr32(s_pHalContext, VERTEX2F(5*16, 10*16));
    EVE_Cmd_wr32(s_pHalContext, VERTEX2F(500*16, 300*16));

    EVE_Cmd_wr32(s_pHalContext, STENCIL_FUNC(NEVER, 0x00, 0x00));
    EVE_Cmd_wr32(s_pHalContext, STENCIL_OP(INCR, INCR));
    EVE_Cmd_wr32(s_pHalContext, BEGIN(FTPOINTS));
    EVE_Cmd_wr32(s_pHalContext, POINT_SIZE((uint16_t )((C1 - 5) * 16))); //inner circle
    EVE_Cmd_wr32(s_pHalContext, VERTEX2II(240, 136, 0, 0));

    EVE_Cmd_wr32(s_pHalContext, STENCIL_FUNC(NOTEQUAL, 0x01, 0x01));
    EVE_Cmd_wr32(s_pHalContext, POINT_SIZE((uint16_t )((C1) * 16))); //outer circle
    EVE_Cmd_wr32(s_pHalContext, VERTEX2II(240, 136, 0, 0));

    EVE_Cmd_wr32(s_pHalContext, STENCIL_FUNC(EQUAL, 0x01, 0x01));
    EVE_Cmd_wr32(s_pHalContext, STENCIL_OP(KEEP, KEEP));
    EVE_Cmd_wr32(s_pHalContext, COLOR_RGB(R, G, B));
    EVE_Cmd_wr32(s_pHalContext, POINT_SIZE((uint16_t )((C1) * 16)));
    EVE_Cmd_wr32(s_pHalContext, VERTEX2II(240, 136, 0, 0));

    EVE_Cmd_wr32(s_pHalContext, STENCIL_FUNC(ALWAYS, 0x01, 0x01));
    EVE_Cmd_wr32(s_pHalContext, STENCIL_OP(KEEP, KEEP));

    EVE_Cmd_wr32(s_pHalContext, END());

Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 733
    • View Profile
Re: Reproducing the demo outline circle in the screen editor
« Reply #5 on: November 08, 2021, 04:38:31 PM »

Hello,

Thank you for the suggestion!

Best Regards,
BRT Community
Logged