Implement Extended Scene Pipeline
Pre-release
Pre-release
Release 0.15.0-Preview.2
STPExtendedScenePipeline
- Add
STPExtendedScenePipelineandSTPExtendedSceneObjectfor rendering with ray tracing. - Add
STPAsyncAccelBuilderas a helper for double buffered async AS builder. - Setup rendering pipeline for screen-space ray intersection testing.
SSRI shader
- Suffix the structure name in shader
STPScreenSpaceRayIntersection.cuhwith Data to avoid name collision. - Change the specification of primitive data. Now it uses object ID to locate an array of instances with that object, and instance ID to locate an array of primitive data, to make support for multiple objects with multiple instances better.
- Both IDs are encoded into the user ID provided during IAS build.
- Remove empty SBT data fields to save memory.
- Enclose all texture types in
SSRIDatainside a structure for easy update. - Change
SSStenciltounsigned char*fromcudaSurfaceObject_tbecause CUDA does not support mapping a stencil texture. - Change environment ray ID to 127 to avoid collision with object ID 0.
STPSceneObject
- Add a new type of abstract object,
STPAnimatedObject, inSTPSceneObject. - Modify
STPAurora,STPStarfield,STPWaterandSTPSunto inherit fromSTPAnimatedObjectto allow user to control the animation timer explicitly.- This is done to make sure these objects use the same animation time when they are rendered again during ray tracing pipeline so the ray traced scene match that of rasterised.
- Note that
STPSunnow takes an absolute time in second rather than previously a delta time.
- Add a helper function in
STPEnvironmentObjectfor checking visibility.
General fixes and improvement
- Loop fusion for texture object build in
STPTextureFactory. - Make function
copyToBuffer()template regarding value normalisation inSTPSingleHistogramFilter. - Fix an incorrect floating point modulo in camera rotate function.
- Add a sampler binding state manager to ensure sampler is unbound from a texture unit once finished to avoid state leakage (sampler overrides texture).
- Deprecate and remove the unsafe sampler binding function.
STPWorldPipeline::STPMemoryManager: instead of taking the reference to the whole world pipeline, now it only takes a CUDA stream because that's the only thing it uses.- Improve documentation and CMake setup to indicate the minimum OptiX version (currently being 7.3).
- Add a new function
getTextureImage()toSTPTexture. - Add
STPSmartDeviceObject::STPGraphicsResourcefor managing GL-CUDA interop buffer and texture smartly. - Fix an incorrect assumption about column-major matrix in
STPAmbientOcclusion.fragandSTPAurora.frag. - Fix an incorrect addressing related to surf2Dread and surf2Dwrite in
STPSplatmapGeneratiorand SSRI shader. - Remove explicit enum value declaration for TotalType in
STPTextureType. - Add more details about coding style in the contribution guide.
- Make sure
STPRandomTextureGeneratorwaits for kernel execution before freeing all memories.
STPNullablePrimitive
- Add
STPUniqueResourcealias as a refactor for long typename.- Replace all use of
std::unique_ptr<std::remove_pointer_t<T>, Del>withSTPUniqueResource<T, nullptr, Del>for consistency.
- Replace all use of
- Improve to make sure it obeys strictly to NullablePointer requirement to avoid superfluous surprises.
STPLogHandler
- Remove
inline staticspecifier for two global variables inSTPLogHandlerto use external linkage. To ensure unique address across DLL on Windows platform, they are defined explicitly in a source file. STPLogHandlernow takes astd::string_view. This is to avoid passing extra and possibly garbage data to the log handler sinceSTPExtendedScenePipelineuses an over-allocated string and retains the previous log content if not overwritten.
Runtime compiler
- Abandon OOP design for
STPDeviceRuntimeBinaryandSTPDeviceRuntimeProgram. - Add 2 handy function in
STPDeviceRuntimeBinaryto quickly retrieve program PTX and CUBIN.
STPOpaqueObject
- Now both shadow and non-shadow variant reside in the same base class for simplicity. This is done to also make future use of
STPExtendedSceneObjecton aSTPOpaqueObjecteasier to reduce complexity of permutation. - Remove implementations for
STPDepthRenderGroupbecause they are too trivial, instead the type aliases are provided.
STPScreen and STPSkybox
- Add
STPScreen::drawScreenFromExecutor()function to use RAII for state management.- The original version now manages states automatically instead of asking user to bind the buffer and use the program.
- Now user is not forced to derive from
STPScreenandSTPSkybox, they can be used as member variable.- This is done because in the future when ray tracing is added to the main rendering pipeline, environment object needs to derived from both
STPScreen(to resolve G-Buffer output from ray tracer) andSTPSkybox(the rasterisation environment rendering), which is ugly.
- This is done because in the future when ray tracing is added to the main rendering pipeline, environment object needs to derived from both
- Remove redundant accessor functions such as
getColorHandlefromSTPSimpleScreenBindlessFrameBufferbecause all fields are public.