Skip to content

Use GL_LINEAR to smooth out elevation #12

@redblobgames

Description

@redblobgames

In render.ts the elevation is stored in the G,R channels

   gl_FragColor = vec4(fract(256.0*e), e, 0, 1);

This prevents us from using GL_LINEAR to smooth out elevations, because it won't interpolate these encoded values correctly.

To get interpolation working, we need a texture format that stores the elevation as a single float, and supports linear blending with the EXT_float_blend extension. Web3DSurvey says this has 90% support as of Sep 2025.

On systems that don't have this extension, we'll get GL_NEAREST like now, but on those 90% of systems, we can get smoother blending.

I don't know how much of a difference this makes so I need to implement it and compare the output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions