Viewcube with outline shading

Опубликовано: 20 Июнь 2026
на канале: Jyrki Koivisto
98
3

One pass wonder... Stupid viewcube done with 3 shaders on one pass


Vertex sends information to geometry shader which passes out 3 times the triangles. Because of blending there will be artefacts if only scaling the shadow and then the normal cube on top. Now it makes shadow of original size then on top of that the scaled shadow and then on top of those the normal cube... Fragment shader know the mouse position and alter cube's alpha channel. Cube is highlighted based on a normal list sent along the vertex positions. Normals are not for the cube only for highlighting the faces, edges and corners, almost works good...