Skip to content

Ctrlmonster/three-octahedral-impostor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Three Octahedral Impostor

Demo

Wip implementation of octahedral impostors in three.js, following this great blog post on octahedral impostors in Fortnite/Unreal Engine by Ryan Brucks and the octahedron unwrapping demo by Sketchpunk Labs.

This repo mostly contributes the atlas generation and showcases a very hacky way to render the impostor at runtime, by just raycasting the original mesh to find the three nearest sprites from the triangle intersection (each vertex represents/encodes the sprite captured from that direction) and weighting them by the barycentric coordinates. The result is not pretty, but it gives an idea of what's possible!

If anyone is interested in contributing, pushing this further along, the proper runtime is what's missing. Skipping raycasts and decoding the octahedron in the shader based on view direction instead (at least I think that's what should be happening) and improving the blending based on depth. The billboard is also not quite rotated correctly (this gets explained in the blog post) which becomes especially noticeable if you look from below or above.

Recourses

Screenshots

Scene Overview Overview Raycasting the original mesh to find the three closest atlas images (here 161, 162, 176):
Mesh Raycast

Finding the sprites on the atlas Atlas Closeup

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages