Rendering to quad has odd sampling issues

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
dart_theg
Posts: 87
Joined: Sun Dec 29, 2024 3:13 am

Rendering to quad has odd sampling issues

Post by dart_theg »

I’m currently rendering my scene and gui to a quad for letterboxing. But I notice especially with smaller images or pixel art that there is an odd aliasing or sampling issue? Like it’s jagged in some places. Sorry I’m not sure what to call it.

https://imgur.com/a/zeuxnCC

It is straight across in the texture but appears like so.

I have aliasing and filtering off. Followed the quad building tutorial from the post processing tutorial.
CuteAlien
Admin
Posts: 10021
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Rendering to quad has odd sampling issues

Post by CuteAlien »

Hm, that's the second really strange problem you have in a row. Just wondering if you have tried updating the graphic card driver? Might be worth a shot.

Otherwise - did you start with example 27 for this? Check if the vertex coordinates and uvs are really all at -1, 0, 1
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
dart_theg
Posts: 87
Joined: Sun Dec 29, 2024 3:13 am

Re: Rendering to quad has odd sampling issues

Post by dart_theg »

I’ll try updating and seeing but last I checked I’m up to date. I also set the driver viewport, maybe that has some issues that I don’t know of, but I can’t imagine it would make jaggies like that if dimensions were off.
dart_theg
Posts: 87
Joined: Sun Dec 29, 2024 3:13 am

Re: Rendering to quad has odd sampling issues

Post by dart_theg »

Yeah my quad has the proper uv and vertex positions. I’m curious if you know setting driver viewport could be a problem. I use it to letterbox and that screenshot I sent is with it active. It only sometimes has that jagged stuff but I can only get it on certain dimensions. At first I thought it was odd dimensions but seems not…
dart_theg
Posts: 87
Joined: Sun Dec 29, 2024 3:13 am

Re: Rendering to quad has odd sampling issues

Post by dart_theg »

I managed to get a more clear visual of what is going on

https://i.imgur.com/Ug8MRng.png
dart_theg
Posts: 87
Joined: Sun Dec 29, 2024 3:13 am

Re: Rendering to quad has odd sampling issues

Post by dart_theg »

Ok I fixed it! It was actually an issue with Direct3D 9. I had to apply an offset to the projection matrix:

float xOff = -1.0f / winW;
float yOff = 1.0f / winH;
CuteAlien
Admin
Posts: 10021
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Rendering to quad has odd sampling issues

Post by CuteAlien »

OK, glad you found. I just took another look at the example and I also found a strange thing - the normal seems a bit off (1, 1, 0) - it's not normalized or going along the plane, should probably be (0,0,1) instead. I'll have to take a closer once I'm a little less tired tomorrow.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply