-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Penumbra with RenderTarget2D and PointClamp sampler state #19
Comments
Hey @matt-clegg, thanks for bringing out this issue! This indeed seems to be a limitation of Penumbra and it'd be nice if we could find a nice solution for this scenario. Penumbra is internally also operating with custom render targets. It recreates the render targets only on window size changes and it always matches the size of back buffer. You are drawing on a custom render target with a different size and this info is currently not picked up by Penumbra. One solution I see is to, instead of using back buffer size, use the size of last set render target. Before I move forward with this, can you try the following:
See if that makes a difference (without you having to scale hulls nor lights). If that doesn't work, perhaps you can share a demo of the issue and I can try debugging it myself. |
See #20 for a potential workaround. |
I'm rendering my game to a scaled down render target, which I then render at the full window size. It seems that penumbra doesn't want to work when I use a render target.
Here's some pseudo code showing my setup:
This resulted in the lighting rendered at the original scale of the render target, and the game at the scaled size:
To overcome this, I scaled up the positions of all hulls and lights by 2 (the render target is half the window size). This seemed to fix it, but then I saw the SamplerState.PointClamp wasn't working.
This is what the game looks like without lighting:
And with lighting:
It's turned blurry, as if the PointClamp filter was disabled.
Are there any ways to overcome this issue? Would it be possible to allow penumbra to render to the same RenderTarget the game is drawn to, allowing it to be scaled up correctly, with the PointClamp sampler state?
The text was updated successfully, but these errors were encountered: