- Home /
Easy way to render a texture, pixel perfectly, with a shader, and get the result?
Normally to render a texture, with a shader, and get the result, you have to:
1) Attach the texture to a material.
2) Attach that material to a quad.
3) Get that quad to somehow fit the full area of a camera.
4) Tell the camera to render to a render texture.
5) Actually tell the camera to do the render.
That's a lot of steps just to do what ought to be possible with a single line of code.
I'd like to render it pixel perfectly, but that's difficult since the UV's of the shader are based on float valuies ranging from 0 to 1, and not pixels. But whatever.
But my main problem is, I did all the above steps, and I discovered that my resulting render texture has a "border" of width of 1 pixel, around the edge, which weren't part of the texture or the shader.
So apparently my quad is ever so slightly not filling the full camera. Of course, my settings are perfect, the quad fits the camera as far as I can tell. But the one pixel border says otherwise.
Sure, I can scale something from 1 to 1.0001 and see if that makes the one pixel border go away, but come on, this is a pixel-perfect shader processing effect I'm doing, and I can't mess around, it has to be absolutely perfectly fitting.
Why isn't there a way to do this without a camera, without a quad, without any of that shet? I should be able to write one line of code, with just the texture, the shader, and boom... it renders it and gives me the result, with no 1-pixel border.
Your answer
Follow this Question
Related Questions
Applying post-processing effects to RenderTextures 1 Answer
How to get the depth values of the camera view? 1 Answer
One-frame delay with 2 cameras 0 Answers
What is the procedure of capturing a particular region using Render Texture 0 Answers
,Can camera output negative values to render texture? 0 Answers