-
Notifications
You must be signed in to change notification settings - Fork 0
Rendering pipeline: EXR textures, shadows, frame graph, IBL #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8d0c86f
a3f00eb
1773e89
65cd336
25f780c
bb31ce7
829aa33
d3ff366
599775b
07d5da1
ed8c84b
9ee4396
96e2754
e24505d
db75e77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,10 @@ patterns = [ | |
| 'git\s+stash\b', # stash / stash pop | ||
| ] | ||
|
|
||
| [[allow]] | ||
| name = "image_convert" | ||
| commands = ["ffmpeg"] | ||
|
Comment on lines
+18
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Search for ffmpeg usage in the codebase to understand necessity and scope.
# Search for ffmpeg references in code and scripts
echo "=== Searching for ffmpeg in code files ==="
rg -n -C3 'ffmpeg' --type-add 'code:*.{cpp,h,py,js,ts,sh,bat,ps1}' --type code
echo -e "\n=== Searching for ffmpeg in test files ==="
rg -n -C3 'ffmpeg' --glob '*test*'
echo -e "\n=== Searching for image conversion or visual regression related code ==="
rg -n -C3 'image.convert|visual.regression|regression.test' --type-add 'code:*.{cpp,h,py,js,ts,sh,bat}' --type codeRepository: dw218192/PTStudio Length of output: 221 🏁 Script executed: # Verify the file exists and show its full content
cat -n allowlist_extra.tomlRepository: dw218192/PTStudio Length of output: 1091 🏁 Script executed: # Search more broadly for any ffmpeg references (including comments and configs)
rg -n 'ffmpeg' -iRepository: dw218192/PTStudio Length of output: 106 🏁 Script executed: # Look for visual regression, EXR, image conversion infrastructure more broadly
rg -n '(visual|regression|EXR|openexr|image|texture|convert)' -i --max-count=20 | head -100Repository: dw218192/PTStudio Length of output: 9811 🏁 Script executed: # Check git log or PR description for context about ffmpeg
git log --oneline --all --grep='ffmpeg|image|visual' -i 2>/dev/null | head -20Repository: dw218192/PTStudio Length of output: 43 Remove unrestricted The allowlist permits execution of any
Recommendation: Remove this allowlist entry unless there is immediate, documented need for 🤖 Prompt for AI Agents |
||
|
|
||
| [[allow]] | ||
| name = "framework_contrib" | ||
| override_deny = true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #usda 1.0 | ||
| ( | ||
| defaultPrim = "Root" | ||
| metersPerUnit = 1.0 | ||
| metersPerUnit = 1 | ||
| upAxis = "Y" | ||
| ) | ||
|
|
||
|
|
@@ -12,6 +12,7 @@ def Xform "Root" | |
| def Material "Gray" | ||
| { | ||
| token outputs:surface.connect = </Root/Materials/Gray/Shader.outputs:surface> | ||
|
|
||
| def Shader "Shader" | ||
| { | ||
| uniform token info:id = "UsdPreviewSurface" | ||
|
|
@@ -25,6 +26,7 @@ def Xform "Root" | |
| def Material "Red" | ||
| { | ||
| token outputs:surface.connect = </Root/Materials/Red/Shader.outputs:surface> | ||
|
|
||
| def Shader "Shader" | ||
| { | ||
| uniform token info:id = "UsdPreviewSurface" | ||
|
|
@@ -38,6 +40,7 @@ def Xform "Root" | |
| def Material "Blue" | ||
| { | ||
| token outputs:surface.connect = </Root/Materials/Blue/Shader.outputs:surface> | ||
|
|
||
| def Shader "Shader" | ||
| { | ||
| uniform token info:id = "UsdPreviewSurface" | ||
|
|
@@ -51,6 +54,7 @@ def Xform "Root" | |
| def Material "Green" | ||
| { | ||
| token outputs:surface.connect = </Root/Materials/Green/Shader.outputs:surface> | ||
|
|
||
| def Shader "Shader" | ||
| { | ||
| uniform token info:id = "UsdPreviewSurface" | ||
|
|
@@ -62,95 +66,102 @@ def Xform "Root" | |
| } | ||
| } | ||
|
|
||
| # Ground plane: large quad at Y=0, extends -5 to 5 on XZ | ||
| def Mesh "Ground" ( | ||
| prepend apiSchemas = ["MaterialBindingAPI"] | ||
| ) | ||
| { | ||
| token orientation = "rightHanded" | ||
| point3f[] points = [(-5, 0, -5), (5, 0, -5), (5, 0, 5), (-5, 0, 5)] | ||
| int[] faceVertexCounts = [4] | ||
| int[] faceVertexIndices = [0, 3, 2, 1] | ||
| rel material:binding = </Root/Materials/Gray> | ||
| normal3f[] normals = [(0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0)] | ||
| token orientation = "rightHanded" | ||
| point3f[] points = [(-5, 0, -5), (5, 0, -5), (5, 0, 5), (-5, 0, 5)] | ||
| token subdivisionScheme = "none" | ||
| rel material:binding = </Root/Materials/Gray> | ||
| } | ||
|
|
||
| # Cube at (0, 0.5, 0), size 1 — sits on ground plane | ||
| def Cube "Cube" ( | ||
| prepend apiSchemas = ["MaterialBindingAPI"] | ||
| ) | ||
| { | ||
| rel material:binding = </Root/Materials/Red> | ||
| double size = 1 | ||
| double3 xformOp:translate = (0, 0.5, 0) | ||
| uniform token[] xformOpOrder = ["xformOp:translate"] | ||
| rel material:binding = </Root/Materials/Red> | ||
| } | ||
|
|
||
| # Sphere at (-2, 1.0, 1), radius 0.5 | ||
| def Sphere "Sphere" ( | ||
| prepend apiSchemas = ["MaterialBindingAPI"] | ||
| ) | ||
| { | ||
| rel material:binding = </Root/Materials/Blue> | ||
| double radius = 0.5 | ||
| double3 xformOp:translate = (-2, 1.0, 1) | ||
| double3 xformOp:translate = (-2, 1, 1) | ||
| uniform token[] xformOpOrder = ["xformOp:translate"] | ||
| rel material:binding = </Root/Materials/Blue> | ||
| } | ||
|
|
||
| # Cylinder at (1.5, 0.75, -1), height 1.5 — sits on ground plane | ||
| def Cylinder "Cylinder" ( | ||
| prepend apiSchemas = ["MaterialBindingAPI"] | ||
| ) | ||
| { | ||
| token axis = "Y" | ||
| double height = 1.5 | ||
| rel material:binding = </Root/Materials/Green> | ||
| double radius = 0.4 | ||
| double3 xformOp:translate = (1.5, 0.75, -1) | ||
| uniform token[] xformOpOrder = ["xformOp:translate"] | ||
| rel material:binding = </Root/Materials/Green> | ||
| } | ||
|
|
||
| # Distant light 1 (main sun): direction ~(0.5, -1.0, 0.3), intensity 3.0, warm white | ||
| def DistantLight "MainSun" | ||
| { | ||
| float inputs:intensity = 3.0 | ||
| color3f inputs:color = (1, 0.95, 0.85) | ||
| float inputs:angle = 0.53 | ||
| float3 xformOp:rotateXYZ = (-60, -120, 0) | ||
| uniform token[] xformOpOrder = ["xformOp:rotateXYZ"] | ||
| color3f inputs:color = (1, 0.95, 0.85) | ||
| float inputs:intensity = 50000 | ||
| matrix4d xformOp:transform = ( (-0.5, 0, 0.8660253882408142, 0), (0.75, 0.5, 0.4330126941204071, 0), (-0.4330126941204071, 0.8660253882408142, -0.25, 0), (0, 5.531754016876221, 0, 1) ) | ||
| uniform token[] xformOpOrder = ["xformOp:transform"] | ||
|
Comment on lines
+119
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Don't orphan the existing light rotation ops.
Also applies to: 130-131 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| # Distant light 2 (secondary): direction ~(-0.3, -1.0, -0.5), intensity 1.5, cool white | ||
| def DistantLight "FillSun" | ||
| { | ||
| float inputs:intensity = 1.5 | ||
| color3f inputs:color = (0.85, 0.9, 1) | ||
| float inputs:angle = 0.53 | ||
| float3 xformOp:rotateXYZ = (-60, 30, 0) | ||
| uniform token[] xformOpOrder = ["xformOp:rotateXYZ"] | ||
| color3f inputs:color = (0.85, 0.9, 1) | ||
| float inputs:intensity = 50000 | ||
| matrix4d xformOp:transform = ( (0.8660253882408142, 0, -0.5, 0), (-0.4330126941204071, 0.5, -0.75, 0), (0.25, 0.8660253882408142, 0.4330126941204071, 0), (0, 5.175130367279053, 0, 1) ) | ||
| uniform token[] xformOpOrder = ["xformOp:transform"] | ||
| } | ||
|
|
||
| # Dome light: low intensity ambient fill | ||
| def DomeLight "AmbientFill" | ||
| { | ||
| float inputs:intensity = 0.3 | ||
| color3f inputs:color = (0.9, 0.92, 1) | ||
| float inputs:intensity = 0.3 | ||
| matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ) | ||
| uniform token[] xformOpOrder = ["xformOp:transform"] | ||
| } | ||
|
|
||
| # Camera at (3, 4, 5) looking at origin | ||
| def Camera "ShadowCam" | ||
| { | ||
| float2 clippingRange = (0.1, 100) | ||
| float focalLength = 35 | ||
| float horizontalAperture = 36 | ||
| float verticalAperture = 24 | ||
| matrix4d xformOp:transform = ( | ||
| (0.85749, 0, -0.51450, 0), | ||
| (-0.29104, 0.82440, -0.48507, 0), | ||
| (0.42426, 0.56569, 0.70711, 0), | ||
| (3, 4, 5, 1) | ||
| ) | ||
| matrix4d xformOp:transform = ( (0.85749, 0, -0.5145, 0), (-0.29104, 0.8244, -0.48507, 0), (0.42426, 0.56569, 0.70711, 0), (3, 4, 5, 1) ) | ||
| uniform token[] xformOpOrder = ["xformOp:transform"] | ||
| } | ||
|
|
||
| def DistantLight "DistantLight" | ||
| { | ||
| float inputs:intensity = 50000 | ||
| matrix4d xformOp:transform = ( (0.33341044187545776, 0, -0.9427817463874817, 0), (-0.7747346758842468, 0.5698425769805908, -0.27398115396499634, 0), (0.5372380614280701, 0.821753978729248, 0.1899915188550949, 0), (1.6580281257629395, 5.08758020401001, 0.15053600072860718, 1) ) | ||
| uniform token[] xformOpOrder = ["xformOp:transform"] | ||
| } | ||
|
|
||
| def Camera "Camera" | ||
| { | ||
| float2 clippingRange = (0.01, 2000) | ||
| float focalLength = 20.78461 | ||
| float horizontalAperture = 36 | ||
| float verticalAperture = 24 | ||
| matrix4d xformOp:transform = ( (0.9927712082862854, 3.725290298461914e-9, -0.12002246081829071, -0), (-0.08421951532363892, 0.7124745845794678, -0.6966254711151123, 0), (0.08551295101642609, 0.7016978859901428, 0.707324206829071, -0), (1.014491081237793, 8.324660301208496, 8.391408920288086, 1) ) | ||
| uniform token[] xformOpOrder = ["xformOp:transform"] | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🏁 Script executed:
Repository: dw218192/PTStudio
Length of output: 41746
🏁 Script executed:
Repository: dw218192/PTStudio
Length of output: 85
🏁 Script executed:
Repository: dw218192/PTStudio
Length of output: 3448
🏁 Script executed:
Repository: dw218192/PTStudio
Length of output: 1049
Refactoring suggested: split conditional env var setup into platform-specific steps.
The current pattern
PTSTUDIO_GPU_BACKEND: ${{ matrix.platform == 'windows-x64' && 'D3D12' || '' }}is functionally safe—the code atcore/src/rendering/webgpu/device.cpp:156usesstd::getenv()and compares against known values, logging a warning for unknown/empty strings and falling back to default auto-selection. However, this generates a spurious warning log on every non-Windows run.Refactoring into separate steps (Windows-only with
if: matrix.platform == 'windows-x64') avoids the unnecessary warning and makes the intent clearer. Apply to both Build project and Run tests steps.🤖 Prompt for AI Agents