Screen.DrawShape after Screen.drawTexture -> black texture

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Screen.DrawShape after Screen.drawTexture -> black texture

Postby m8f » Sun Nov 14, 2021 8:24 am

This happens only on OpenGL and OpenGL ES render backends, and only on Hardware Accelerated render mode.

Manjaro Linux x86_64, 5.13.19-2-MANJARO, NVidia 470.63.01.

Checked on GZDoom 4.7.1 and Git master (commit 01b825b18).

If a texture is drawn with Screen.DrawShape after Screen.Screen.drawTexture in the same function - it's drawn as a black rectangle.

black.png


Code: Select allExpand view
  override
  void renderOverlay(RenderEvent event)
  {
    {
      Screen.drawTexture( TexMan.checkForTexture("pista0")
                        , false
                        , 200
                        , 200
                        , DTA_CenterOffset , true
                        , DTA_DestWidthF   , 116
                        , DTA_DestHeightF  , 60
                        );
    }

    {
      let shape = new("Shape2D");
      shape.pushVertex((-0.5, -0.5));
      shape.pushVertex(( 0.5, -0.5));
      shape.pushVertex(( 0.5,  0.5));
      shape.pushVertex((-0.5,  0.5));

      shape.pushCoord((0, 0));
      shape.pushCoord((1, 0));
      shape.pushCoord((1, 1));
      shape.pushCoord((0, 1));

      shape.pushTriangle(0, 1, 2);
      shape.pushTriangle(0, 2, 3);

      let transformation = new("Shape2DTransform");
      transformation.scale((116, 60));
      transformation.translate((200, 400));

      shape.setTransform(transformation);

      Screen.drawShape(TexMan.checkForTexture("pista0"), false, shape);
    }
  }


If I put Screen.drawTexture at the end, everything is drawn correctly.

Runnable example:
black-shape.pk3
You do not have the required permissions to view the files attached to this post.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Other Linux 64-bit

Return to OpenGL Renderer Bugs

Who is online

Users browsing this forum: No registered users and 0 guests