Representación de una isla de Moana en menos de 10,000 líneas de código Swift

Una isla de Moana (2048x858 píxeles, 64 spp) renderizada con Gonzales al almacenamiento de Google Cloud con 8 vCPU y 64 GB de memoria en aproximadamente 26 horas.  En memoria, ocupa unos 60 GB.  Reducción de ruido con OpenImageDenoise.
Una isla de Moana (2048 × 858 píxeles, 64 spp) renderizada con Gonzales al almacenamiento de Google Cloud con 8 vCPU y 64 GB de memoria en aproximadamente 26 horas. Se necesitan unos 60 GB de memoria. Reducción de ruido con OpenImageDenoise.

, Walt Disney Animation Studios «», , Hyperion. :





  • Hyperion ();





  • Renderman;





  • PBRT;





  • Embree/OSPRay;





  • A hobby renderer ( Embree);





  • Moana RTX ( Optix);





  • GPU-Mononui ( Optix).





, Gonzales. PBRT, Swift ( C ++ OpenEXR Ptex) () Google Cloud (8 , 64 RAM). , , C/C++, . vi Swift Ubuntu Linux Xcode macOS, .





Swift?

, C C++. - (, ), . , , ( , , ) . C++, , Python ( ), Go ( C) , Rust Swift. Swift - ( «fn main» «impl trait»). , , LLVM Clang, , ) ) . , , , , , , . , , , , , , , , . , .





-

. (file.availableData, : .utf8), , . . Scanner Foundation. InputStream 64- UnsafeMutablePointer <UInt8>.





— . . , . , , , perf. FixedArray Swift. , , , perf.





, Linux macOS, . :





  • Perf: Linux , . , , , , . : , . swiftretain, release, (heap).





  • Valgrind Memcheck: , . , , : , , . Swift: malloc new sharedpointers, — , .





  • Xcode: Time Profiler, Leaks Allocations, , Perf Valgrind, . . , (Visual Studio, GCC IRIX, ? MIPSPro?).





Swift , , . , , . , new shared_pointers , , .





FlameGraph — , , . : . , Protocol Witness, .





- : Gonzales 23 , 57 , 47 2 . . — TrowbridgeReitzDistribution Texture: , , . - : , Gonzalez Primitive, PBRT, , , Boundable, Intersectable, Emitting ( ) . : BoundingHierarchyBuild Boundable Intersectables, BoundingHierarchy. , Boundable Intersectable (var primitives = Boundable&Intersectable).





, BoundingHierarchy [AnyObject&Intersectable]. : 





1. ; 





2. AnyObject ( ), , , (OpaqueExistentialContainer) 40 — Swift , (ClassExistentialContainer) 16 , , Swift . , : .





, 10 000 — Swift. — . PBRT , 1000 paramset.[h|cpp]. Swift :





protocol Parameter {}







extension Array: Parameter {}







typealias ParameterDictionary = Dictionary<String, Parameter>







, , , , . ( , , PBRT-v4.)





C ++ Ptex OpenEXR: C ++ Swift , , , . OpenEXR Ptex , extern "C". C ++ (100 Ptex, 82 OpenEXR) — OpenEXR Ptex.





, Google Compute Engine 8 64 , , — , , , . , , . , , .





  • . . , PBRT-v3, , Ptex. .





  • : Gonzalez , , 177 , . SAH . .





  • : pbrt , «» , . : pbf Swift.





  • : , . ?





  • , . LLVM : in-memory, machine readable () human readable, — . ? PBRT ( ), PBF USD () BHF ( ), .





  • : «», Gonzales , . , . PBRT, Gonzales.





  • Bump mapping: .





  • Displacement mapping: .





  • : , . , . , , , ?





  • . : 4×4, , . , , , — , , . , ( , ) , , , ? ?





  • : OpenImageDenoise, , , Swift. , beauty, albedo normal image , .





  • USD: Universal Scene Description Pixar.





  • : discrepany-based sampling multi-jittered sampling.





  • : PxrUnified ( , … ) Manifold Next Event Estimation. , - , , .





  • . PBRT.





  • : Embree . Gonzales .





  • : , PBRT-v4, , , . , , , Optix , , . , Optix. , , (Swift) ; 448 , -, . , AVX , , . NUMA, ALU . , , : . t , //, Chromium.





. , , -. PBRT — ( , ).








All Articles