|
??????NVIDIA RTX??????????(Real Time Ray Tracing)?????????????????????????????????????????????????????????????????????????????RTX??????????????
?????????Unity????????????????????????????????
1????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????10????????.????1080P???????????1920*1080*10=20 736 000?????????????
???????????????:
(1)????????????
(2)?????????????
(3)??????????
(4)????????????????????
(5)???????????(2)???????????????????????
????????(2)??????????????????????????????????????????????????????????????????????????????????????????????????RTX????????????????????
?RTX???????????????????????????????????????????????(AO)???????????????????????????????????????(Noise)??????????????????????????????????RTX?????????????????????????????????????????????????
2.???????
????????????????????????????????????????????????????????????/????????????
???????
????
??????
????????Unity???????????????????DrawCall???????/???????????????????????????????
????????????????????????????VectorArray??????????????????
??????????????????????????????????????????????????
???????????????????????????????????CSDN???
??????-CSDN??
???????????????????????????????????????????
- if (HitScene(rayTemp, intersection, matIndex, inGeometry))
- return 0;
- else
- return 1;
复制代码??????????????
?????????????
???????????
- if (HitScene(rayTemp, intersection, matIndex, inGeometry))
- return float4(intersection.normal,0);
- else
- return 1;
复制代码
???????????????
??????????
- if (mat.reflectiveness != 0)
- {
- rayTemp.direction = reflect(rayTemp.direction, normal.xyz);
- }
- else
- {
- float refractIndex = dot(mat.refractiveIndex, channel);
- refractIndex = intersection.inside ? refractIndex : 1 / refractIndex;
- float3 reflection = refract(rayTemp.direction, normal, refractIndex);
- if (dot(reflection, reflection) < 0.001)
- {
- rayTemp.direction = reflect(rayTemp.direction, normal.xyz);
- }
- else
- {
- rayTemp.direction = reflection;
- inGeometry = !inGeometry;
- }
复制代码
???????????
??????????
????????????????????????????????????????????????????????????????????????HDR??????
?????????
???????????????RGB??????????????????????????????????????????????
???????????
????????????????????????????????????????????????????ps_4_0????????????????ColorMask??????????????????????????
???????????
????????????
3.?????
?????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????
??????????????????????????????Alpha???1?????????????
?????????????????????????????????
????????????????????????????????????????
https://www.zhihu.com/video/1028757005678256128?autoplay=false&useMSE=
???
1.?????????
???????float4???_Vertices??????????????????????????????????????w?????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????
???????
??????????????????????????????????????????
????????????Shader??????????????????CPU?????????
2.?????
??????????????????????
?????????????10??????????1080p?????????1920*1080*10=20 736 000?????????
??????????????????????????????????????????????????????????????10??????????????10??????????
??????????????????????????????????????
????????????????????rgb???????????????4???????????208?????
????1080p???????????????????????????????
1920*1080*3*4=24,883,200
?2500???????
1920*1080*3*4*208=5,175,705,600
?5.2?????????????
????????????????????????30?????????????0.033???????????????????????GPU??????
???208??????????????????????????????????????????????????????
????????????????????????????????????????????????
???????????????????????????????????????????????????????
NVIDIA RTX?????????????????????????????????????????????
??????????????????????????????
????????
https://link.zhihu.com/?target=https%3A//github.com/IceDustEl/SimpleRayTracing
???IceDust
?????https://zhuanlan.zhihu.com/p/45335463
|
|