Skip to content

Commit

Permalink
feat: Generating Shaders ( Fixes #163 )
Browse files Browse the repository at this point in the history
Fixing Internal Shader Names and Color Parameters
  • Loading branch information
James Brundage committed Feb 13, 2024
1 parent a5cd46c commit d8b76c5
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions Build/obs--shaders.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,7 @@ $($shaderParameterSet.Group | Out-String)
Out-File -Path $env:GITHUB_STEP_SUMMARY -Append
}

foreach ($shaderParameterInSet in $shaderParameterSet.Group) {
if ($env:GITHUB_STEP_SUMMARY) {
"
Processing $($shaderParameterInSet | Out-String)
" |
Out-File -Path $env:GITHUB_STEP_SUMMARY -Append
}

foreach ($shaderParameterInSet in $shaderParameterSet.Group) {
$shaderMatch = "$(@("$($shaderParameterInSet)") -join '')" -match $FindShaderParameters
$shaderMatch = [Ordered]@{} + $matches
$shaderParameterSystemName = $shaderMatch.ParameterName
Expand Down Expand Up @@ -194,7 +187,7 @@ Processing $($shaderParameterInSet | Out-String)
float { [float] }
float2 { [float[]] }
float3 { [float[]] }
float4 { [float[]] }
float4 { [string] <# float4 is usually a color #>}
float4x4 { [float[][]]}

default {
Expand Down Expand Up @@ -248,9 +241,9 @@ Processing $($shaderParameterInSet | Out-String)


$ShaderProcess = [scriptblock]::Create(@"
if (-not `$psBoundParameters['ShaderText']) {
`$shaderName = `$shaderName
`$ShaderNoun = '$ShaderNoun'
`$shaderName = '$shaderName'
`$ShaderNoun = '$ShaderNoun'
if (-not `$psBoundParameters['ShaderText']) {
`$psBoundParameters['ShaderText'] = `$ShaderText = '
$($ShaderContent -replace "'","''")
'
Expand All @@ -268,7 +261,7 @@ switch -regex ($myVerb) {
[Regex]::Escape($FilterName)
}
else {
[Regex]::Escape($shaderName),[Regex]::Escape($ShaderNoun -replace '^OBS' -replace 'Shader$') -join '|'
[Regex]::Escape($ShaderNoun -replace '^OBS' -replace 'Shader$'),[Regex]::Escape($shaderName) -join '|'
}
))"
if ($SourceName) {
Expand Down

0 comments on commit d8b76c5

Please sign in to comment.