Skip to content

Implement Extended Scene Pipeline

Pre-release
Pre-release

Choose a tag to compare

@stephen-hqxu stephen-hqxu released this 02 Oct 13:17
faf9a37

Release 0.15.0-Preview.2

STPExtendedScenePipeline

  • Add STPExtendedScenePipeline and STPExtendedSceneObject for rendering with ray tracing.
  • Add STPAsyncAccelBuilder as 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.cuh with 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 SSRIData inside a structure for easy update.
  • Change SSStencil to unsigned char* from cudaSurfaceObject_t because 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, in STPSceneObject.
  • Modify STPAurora, STPStarfield, STPWater and STPSun to inherit from STPAnimatedObject to 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 STPSun now takes an absolute time in second rather than previously a delta time.
  • Add a helper function in STPEnvironmentObject for checking visibility.

General fixes and improvement

  • Loop fusion for texture object build in STPTextureFactory.
  • Make function copyToBuffer() template regarding value normalisation in STPSingleHistogramFilter.
  • 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() to STPTexture.
  • Add STPSmartDeviceObject::STPGraphicsResource for managing GL-CUDA interop buffer and texture smartly.
  • Fix an incorrect assumption about column-major matrix in STPAmbientOcclusion.frag and STPAurora.frag.
  • Fix an incorrect addressing related to surf2Dread and surf2Dwrite in STPSplatmapGeneratior and SSRI shader.
  • Remove explicit enum value declaration for TotalType in STPTextureType.
  • Add more details about coding style in the contribution guide.
  • Make sure STPRandomTextureGenerator waits for kernel execution before freeing all memories.

STPNullablePrimitive

  • Add STPUniqueResource alias as a refactor for long typename.
    • Replace all use of std::unique_ptr<std::remove_pointer_t<T>, Del> with STPUniqueResource<T, nullptr, Del> for consistency.
  • Improve to make sure it obeys strictly to NullablePointer requirement to avoid superfluous surprises.

STPLogHandler

  • Remove inline static specifier for two global variables in STPLogHandler to use external linkage. To ensure unique address across DLL on Windows platform, they are defined explicitly in a source file.
  • STPLogHandler now takes a std::string_view. This is to avoid passing extra and possibly garbage data to the log handler since STPExtendedScenePipeline uses an over-allocated string and retains the previous log content if not overwritten.

Runtime compiler

  • Abandon OOP design for STPDeviceRuntimeBinary and STPDeviceRuntimeProgram.
  • Add 2 handy function in STPDeviceRuntimeBinary to 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 STPExtendedSceneObject on a STPOpaqueObject easier to reduce complexity of permutation.
  • Remove implementations for STPDepthRenderGroup because 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 STPScreen and STPSkybox, 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) and STPSkybox (the rasterisation environment rendering), which is ugly.
  • Remove redundant accessor functions such as getColorHandle from STPSimpleScreenBindlessFrameBuffer because all fields are public.