Using custom material variable to pass parameters to PointLine shaders
See original GitHub issueI am trying to pass custom parameters (state) to my own point and line shaders, so that I can color the geometry depending on whether it is in a selected/unselected state, etc. For this I tried to use the pfParams
field from the PointLineMaterialStruct
in the shader for which I did the following steps:
- Overrode
PointNode.OnCreateRenderCore
to create a customPointLineRenderCore
- Defined a render technique using my custom .hlsl shaders and added to a custom
EffectsManager
class - Defined a custom
MaterialCore
class with an overriddenCreateMaterialVariables
method to initialize … - A custom
MaterialVariable
class in which I overrode theOnInitialPropertyBindings
method to add my custom property bindings for the above states
However, this doesn’t seem to work. The CreateMaterialVariables
does not seem to be getting invoked in the first place. The above changes can be found here: https://github.com/DynamoDS/Dynamo/pull/10709
Any advice on whether the above approach is correct or any documentation on how to write a custom material variable to pass additional data to the pointline shaders would be really useful.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Accessing Shader Variables of Custom Pass Volume's ...
Hello, You can access the material of a pass with the customPasses accessor in the Custom Pass Volume. Each element in this list...
Read more >Unity Shader Graph - Changing Parameters in Script - YouTube
... to show you how to change a shader's parameters in a C# script. ... the video then please respond with a like...
Read more >ARKit Tutorial: How to attach Custom Variables to a Metal ...
To use custom input variables in a Metal shader, first declare those variables as input parameters to your Metal shader functions, using an ......
Read more >Accessing and Modifying Material parameters via script
SetInt, Set an integer value in the material ... shader to another that use the same textures or properties and values will be...
Read more >Cocos Creator 3.8 Manual - Optional Pass Parameters
Optional Pass Parameters. The parameters in Pass are mainly divided into two parts: Developer-customizable Inspector panel parameter properties .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added an example to show how to use your own constant buffer. #1360 You may need to use the nightly build, otherwise you may have to duplicate the codes for PointMaterialCore/PointMaterialVariables/PointMaterial.
It depends on whether you want to create a special scene node or material. The point line constant buffer still have 2 empty padding slots you can use.
In PointLineRenderCore, you can add some properties to set
PointLineModelStruct
padding fields. And then you can use those two fields in your pixel shader.Or create a new constant buffer for your pixel shader, adds a new
ConstantBufferComponent
like inMaterialVariableBase
. Set values for the constant buffer and bind it duringBindMaterialResources
to the constant buffer slot.