Skip to content

Writing to EXR yields truncated negative values #4

@transcendtient

Description

@transcendtient

For now I'm remapping the values to positive numbers. 255 is arbitrary and causes rounding errors similar to the vertex rounding you see in playstation games. The resulting textures are "white" but contain the animation data.

float Remap(float aValue) { float normal = Mathf.InverseLerp(-255, 255, aValue); return Mathf.Lerp(0, 255, normal); }
And remapping the pixel.
pixel.r = Remap(position.x); pixel.g = Remap(position.y); pixel.b = Remap(position.z);

I've rewritten the ShaderGraph as a standard surface shader, and to account for this 255 value I'm doing this.
position -= float3(255/2, 255/2, 255/2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions