Skip to content

Conversation

@marauder2k7
Copy link
Contributor

Shader gen now produces a shaderData class that should make it easier to change macros on procedural shaders

ShaderGen now caches files and the shaderData so different stage files can be reused

Note: Starter for the shaderNodes is in here only because some datatypes have been updated that are used within shaderGen

Shader gen unification
Shader node features can now be initialized with parameters set through FEATUREMGR
This is to facilitate creation of node features from script.
ShaderNode parameters are now no longer sent around as a void* and now use base type FeatureParamsBase
add output vars to the param types
fixed gl bug need samplertype
Added CastOp logic, prints out a cast operation
MatrixInitialization operation, takes input langelements and initializes a matrix
Other functions added to langelement
Cross api support for vertex positions
matrixmultiplyop added for multiplying matrix with other types
automatically expands or shortens vec types to suit the matrix
Added identity to the matrix initialization op.
Use resolve source type for other shaderops
This allows us to be more dynamic in the shaderop logic
moved function out to langelement, this allows it to be used inside shaderFeatures
ShaderGen now generates a ShaderData class to simplify macro switchups
ShaderData caches mInstancingFormat

ShaderGen now creates a cache of the files that already exist, and if it exists it will return and use that file instead of regenning a new one. Vertex files can be used for multiple pixel files and vice versa

Requires partial shadernode setup due to changes on how shader feature parameters are handled
Added index to the cache name
Moved the hash out to the torque namespace
DX now outputs the compiled shader
some shader features require these to be checked by both vert and pixel stages (similar to alphatest)
vertex shaders need to regen on run again to get the vertex format setup
move skipregen initialization
@marauder2k7 marauder2k7 force-pushed the ShaderGen-Produce-ShaderData branch from 0e763d3 to 4ceeb07 Compare December 10, 2025 07:23
move clearing of the map out of flushproceduralshaders, this function is now empty, not sure if this is going to cause issues elsewhere but what was happening was postfx manager was setting the hdr format after the level had been loaded, the materials for a few objects were being setup but then the shadergen process would execute on them again and it would clear the cache and cause double ups
always running into issues with this as at times features are coming in with a different index and that affects how another stage is interacting with that shader. This produces alot more shaders, previous run with these was around 500 but without it is producing over 800 (this includes tso compiled output)

This may be something that will only work for the shadernodes as users will be designing those.
3 clean run throughs with switches between levels and did not see the same issues as before. so we should be able to reintroduce the stage seperation checks
hopefully it stays that way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant