Skip to main content
7 events
when toggle format what by license comment
Jan 23, 2016 at 16:59 comment added Yattabyte Oh I see, so the texture being set to GL_FLOAT circumvents that problem from occurring. Then that explains why I didn't really notice any differences.
Jan 23, 2016 at 16:56 comment added Nils Ole Timm It's not so much offsetting them as mapping them from the [-1,1] into the [0,1] range. Because if you store it in a non-floating point texture, it will get mapped to colors between 0 and 1, so all the negative values would have been turned into 0. In order to avoid that you tend to map the normals into the 0 to 1 range. But that depends on your render target.
Jan 23, 2016 at 16:53 vote accept Yattabyte
Jan 23, 2016 at 16:52 comment added Yattabyte Alright, this seems to have vastly improved the results I had. I am still a bit curious though - should I be offsetting the normals before storing and reading them (the normal * 2 - 1 and normal * 0.5 + 0.5)? I don't seem to see any difference on my end right now between doing it and not doing it.
Jan 23, 2016 at 15:33 comment added Nils Ole Timm Either will work, it's just important that you are consistent.
Jan 23, 2016 at 15:22 comment added Yattabyte I've heard a lot of bad things about transforming normals to view space, would it be sufficient to do that in this case, or should I transform my sample back into world space?
Jan 23, 2016 at 13:34 history answered Nils Ole Timm CC BY-SA 3.0