Download

Can materials sample from 2-channel (PF_R8G8) textures?

I’m working on a simplified foliage collision system, very similar to Uncharted 4’s one.

The system basically involves writing ‘Impulses’ to a normal map, and extracting that normal map for WPO in the shader. At the moment I’m using a 4-channel (RGBA) texture but this seems kind of wasteful, given that I only care about the R and G components and am iterating over twice as much data in some cases.

Is it possible for Materials to read from 2-channel texture formats (PF_R8G8 in the engine, or even PF_V8U8), or am I wasting my time with this and just have to suck up the cost? Working with Binary / Launcher build btw.

EDIT: Well, seems as though they can. I’m writing pixel data without any issues by the looks of it and UMG can read this in a material. Cool stuff!

Make sure you release it on marketplace when you’re done, I’d kill for Uncharted 4’s vegetation collision!