MatParamOverride - Debug - Help figuring it out

I have a cached Material that is being used for a couple of thousand Quads, but some of them need special shader values. So I use “MatParamOverride” class to do this. But my shader is never getting the override value. It gets the default value on the variable “zoneHasLight” Float 0 - 1. Default is 1.

It has multiple override values. If I debug, I can see the Spatial on those items has the localOverride list defined with the right value. But the shader still doesn’t get the value.

Where in the JME library right before it calls the render, is it calling to get the param override values?

I want to make sure I’m doing it right.

Update: All of these quads are put into a batchNode. Can that have something to do with it. I have a 64x64 grid with N,W,E,S,Floor,Ceiling possible Quads, So every grid can have 6 quads, then I put them into a 16x16 batchNodes and then put into a Node for that type of Wall. I just noticed I have “Secret Walls” that are not batched, and they do get the Override Params. So I’m thinking it is related to BatchNode, is that something that is not supported.

Material parameter overrides happen after batching.

Not sure what that means.

BatchNode merges all the geometries with the same material into a single geometry (the batch) with a single material. Mat param overrides won’t work since they need the geometries to be rendered separately

1 Like

Thanks. That is what I was thinking. My grid map has 4 zones, and those zones override those parameters. What I will do is batch by 16x16 by zone. Since that will work for me.


1 Like