Get screen resolution in blueprint or material
I need to get uv offset for a single pixel to sample screen texture in the postprocessing material. E.g.:
X X o X X
where o is the current pixel and X are neighbor pixels. I know UV for o, to get to X pixels I need to know screen resolution, so that I can do 1/width (or 1/height) and add that offset to the original UV coords. Is there any way to query those number inside postprocessing material or a blueprint?
asked Nov 04 '14 at 01:32 PM in Rendering
Inside a normal Blueprint, you can get teh viewport size with the PlayerController:
These are the same values you get when you are in the HUD Class.
But i can't tell you how to get this inside your Postprocessing material. I'm a big noob in materials :D
Maybe you can use this as a dynamic scalar for your material or something :X (like a Healthbar does).
answered Nov 04 '14 at 01:41 PM
I think I've found the answer to my own question: to get the offset one need to use SceneTexelSize expression in the material (https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ExpressionReference/Coordinates/index.html#scenetexelsize). No need to query resolution and invert it!
answered Nov 04 '14 at 02:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here