Repository navigation
Keep the fog RT shader table alive and cache the reference point cast - #126
Open
JohnGreenFC wants to merge 1 commit into
Open
JohnGreenFC wants to merge 1 commit into
JohnGreenFC wants to merge 1 commit into
Conversation
…nce point cast Keep the volumetric fog raytraced shadow shader table alive between frames. Cache the reference point cast in EveSpaceObject2.
Comment on lines
+541
to
+544
| if( m_referencePointSource != m_ballPosition.p ) | ||
| { | ||
| refObject->GetReferencePoint( &referencePosition, time ); | ||
| m_referencePointSource = m_ballPosition.p; | ||
| m_referencePoint = BlueCastPtr( m_ballPosition ); |
| TRINITY_STATS_ZONE( "Create shader table" ); | ||
| m_shaderTableDesc.AddRayGenShader( rayGenName.c_str(), material ); | ||
| m_shaderTableDesc.AddMissShader( missName.c_str(), material ); | ||
| m_rtShadowShaderTable.Create( m_shaderTableDesc, pipelineState, renderContext.GetPrimaryRenderContext() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Goal: remove two pieces of per-frame work whose inputs rarely change, so they become do-once-and-reuse.
1. Volumetric fog raytraced shadow shader table (
Tr2VolumetricsRenderer).The froxel fog pass that traces sun shadows built a local
Tr2RtShaderTableALon the stack every frame, which created a committed GPU upload buffer, filled it, and released it again at the end of the frame. The shader table is now a member of the renderer, so its buffer persists and is only rebuilt when the description changes. The same pass was also constructingBlueSharedStringobjects for its technique name, shader options and parameter names on every call; those are now file-scope constants.2. Reference point cast (
EveSpaceObject2).Each update cast the object's ball-position function to
IEveReferencePointto read the reference position, which is an interface query on every object every frame. The cast result is now cached together with the pointer it was taken from, and only redone when the ball-position object is replaced.Linked issue (optional)
Testing
Windows, DX12, release build. Measured in the EVE Frontier client on the QA Megastructure route (1080p, low preset) against origin/main: about -0.5 ms frame mean with raytraced shadows and -0.65 ms with cascaded shadows (single flights, ~0.5 ms noise band; the low preset sets volumetrics to LOW, so the fog part is understated there). Smoke test of this branch alone: full route flown with raytraced shadows, no frames over 100 ms, no crash dumps. Not built on Mac.
AI assistance
AI testing, investigation and CL explanation