Home › Forums › Games202-高质量实时渲染 › 作业一阴影很小 Tagged: 【作业1】 This topic has 4 replies, 5 voices, and was last updated 3 years, 7 months ago by 小夜子. Viewing 4 reply threads Author Posts 2021年4月5日 at 上午10:37 #8031 Score: 0 由乃克斯Participant 作业一阴影很小,不知道是哪里的问题,求教 Attachments:You must be logged in to view attached files. 2021年4月5日 at 下午2:37 #8035 Score: 0 tftlParticipant Karma: 1 pt 看上去像是projection的cube参数有问题,先画一下shadowmap看看 具体方法参考这里 This reply was modified 3 years, 8 months ago by tftl. 2021年4月10日 at 上午12:16 #8097 Score: 0 zhishaoParticipant Karma: 2 pts SM取出来的值unpack后已经在[0,1]了,不需要再归一化到[0,1]了 2021年4月10日 at 下午1:15 #8104 Score: 0 青麈Participant Karma: -2 pt 1.求 shadowCoord,归一化到[0,1] vec4 shadowCoord = vPositionFromLight/vPositionFromLight.w; shadowCoord.xyz = shadowCoord.xyz*0.5+vec3(0.5,0.5,0.5); 2.填充API float useShadowMap(sampler2D shadowMap, vec4 shadowCoord){ //return 1.0; vec4 rgbaDepth = texture2D(uShadowMap,shadowCoord.xy); float depthZ = unpack(rgbaDepth); //depthZ = depthZ*0.5+0.5; float shadow = shadowCoord.z > depthZ ? 0.0 : 1.0; return shadow; } 2021年4月30日 at 下午3:39 #8358 Score: 0 小夜子Participant haha,我一开始也这样犯这个错误。要先对vPositionFromLight归一化再去用,不然会被齐次坐标最后一项给影响到。 Author Posts Viewing 4 reply threads You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In