graphics参考技术文章存档

来源:互联网 发布:des算法例子 编辑:程序博客网 时间:2024/05/11 16:05

1.Ray marching

http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/

ShaderToy code: https://www.shadertoy.com/view/XlXfRn



2.Tri-Planar Texture Mapping

https://gamedevelopment.tutsplus.com/articles/use-tri-planar-texture-mapping-for-better-terrain--gamedev-13821


从三个方向分别映射,然后blend

vec3 texCube( sampler2D sam, in vec3 p, in vec3 n ){        vec4 xaxis = texture( sam, p.yz)*abs(n.x);    vec4 yaxis = texture( sam, p.xz)*abs(n.y);    vec4 zaxis = texture( sam, p.xy)*abs(n.z);        vec4 tex = xaxis+yaxis+zaxis;    return vec3(tex.x,tex.y,tex.z);}