//读取深度
float readDepth( sampler2D depthSampler, vec2 coord ) {
vec4 pixel = texture2D(depthSampler, coord);
return pixel.r;
}
//计算世界坐标
vec3 computeWorldPos(vec2 uv){
float depth = readDepth(tDepth, uv);//场景深度值
vec4 pos;
pos.w = 1.0;
pos
从着色器中重建世界坐标
于 2023-05-31 09:06:30 首次发布