cnlohr / cnballpit-vrc

Other
28 stars 3 forks source link

How do I customize the Ball Pit? #26

Open Whaddageek opened 1 day ago

Whaddageek commented 1 day ago

Hi there,

I've been digging into this repository and I can't discern how to customize the size and shape of the ballpit despite looking in both the Lagoon and "Ooops All Balls" scenes. I've tried adjusting the Depth cameras, but there seems to be some third element in play to actually resize/reshape the ball pit itself.

Additionally, how would I adjust the colours of the balls?

cnlohr commented 1 day ago

So, this is all a rather deep set of questions. shape/size - https://github.com/cnlohr/cnballpit-vrc/blob/main/Assets/cnballpit/shaderCalcPrimary.shader#L298 You can change from one of these pre-set modes.

To change size, change the size of the camera bounds for top-view and bottom-view cameras and change scale of ball pit, there might be a third thing I've forgotten?

Colors and output are determined by this shader: https://github.com/cnlohr/cnballpit-vrc/blob/main/Assets/cnballpit/shader_billboardout_SV_Coverage_New.shader#L188-L221

Colors are in the selected area.

_Mode selects actual colors.

Actual shading is determined by this section of code: https://github.com/cnlohr/cnballpit-vrc/blob/main/Assets/cnballpit/shader_billboardout_SV_Coverage_New.shader#L687-L794

Additionally, you may need to set _BallRadius and WorldSize on matCalcPrimary materials (both materials)

Please let me know where this gets you - please include pictures or video of appropriate questions.