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!
User avatar
m8f
 
 
Posts: 1446
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Screen.DrawShape after Screen.drawTexture -> black texture

Post by m8f »

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 all

  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.

Return to “OpenGL Renderer Bugs”