DK22Pac / plugin-sdk

An SDK for developing ASI/CLEO plugins for GTA San Andreas, GTA Vice City and GTA III
zlib License
427 stars 116 forks source link

Problems rendering RwRaster using RwIm2DRenderIndexedPrimitive #122

Closed 0x416c69 closed 3 years ago

0x416c69 commented 3 years ago

I'm trying to render a texture using RwIm2DRenderIndexedPrimitive.

I'm setting all the necessary Render States and the raster itself correctly but as a result I'm getting this in my screen: image

While what I should get is this: ImGuiD3D9Test_2021-08-14_23-17-26

(Zoom in to see the difference)

It kind of looks like an extra layer of "border" of some kind is being added around every non-transparent (i.e. alpha != 0) pixel. Render States related to "border" (i.e. rwRENDERSTATEBORDERCOLOR) are disabled btw.

I'm rendering near a Render2dStuff call hook, I am absolutely clueless that why textures are being rendered like this. I've tried debugging through PIX to replicate this inside pure d3d9 calls but I've failed. I don't know if this is some kind of shader or not but inside rxD3D9Im2DRenderFlush function (which gets called in every RwIm2DRender functions) these code are used:


    /* Set the vertex shader */
    RwD3D9SetVertexShader(NULL);

    /* Disable any pixel shader */
    RwD3D9SetPixelShader(NULL);