sebastian.vesenmayer Posted March 5, 2021 Posted March 5, 2021 Hello, we do have issues when creating a Texture Object the y coordinates don't match between opengl and directx. The used textures are upside down in this case. This bug can be seen in 2.11 and 2.13, maybe older versions too. Is there any quick fix? Thanks texture_swap_reproducer.zip
silent Posted March 5, 2021 Posted March 5, 2021 Hi Sebastian, That's because DX and GL have different coordinate systems. You need to check Render::isFlipped() flag and flip your textures to match the desired results. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
sebastian.vesenmayer Posted March 5, 2021 Author Posted March 5, 2021 How can I flip a Texture object? Is there a method or do I need to manually change pixeld data? Do I need to flip the Texture object every time after rendering to it? Should this not be API independently?
silent Posted March 5, 2021 Posted March 5, 2021 The easiest way to do this is write a custom shader that will flip the incoming texture and call it after each renderTexture(). Do you need any help with this? We can't automatically do this because we don't really know when and how this texture will be used after (will it be assigned to an object or directly displayed on screen as in your scenario). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
sebastian.vesenmayer Posted March 5, 2021 Author Posted March 5, 2021 We are using this in 2 ways right now. For displaying directly and postprocessing it in a shader. I did already the workarround for displaying directly, by swapping the texture coordinates of a plane, but I think using the uv_transform would be a better solution. The second use case is in a compute shader, so I may duplicate this code and change it for directx then.
silent Posted March 5, 2021 Posted March 5, 2021 Swapping UVs is also fine. Didn't think about it :) How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts