Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
140 stars 2 forks source link

Refraction transparancy mode inbuilt to the standard PBR shader #3190

Open Zefnoly opened 5 days ago

Zefnoly commented 5 days ago

Is your feature request related to a problem? Please describe.

Right now to get refractive transprancy or effects, you have to stack two meshes, one with alpha based transparency, another with refraction. Most modern games or older games has refraction as an inbuilt function in their shaders as a separate option alongside alpha shaders.

This can allow for material with opaque features to have refractive properties for transparency and maintain things like dynamic shadows from my experience rather than to use alpha mode which often disables those abilities (unless this is a hard limit of current unity container)

Describe the solution you'd like

On the current standard PBR there are things like transparancy mode. Maybe an additional mode could be "refractive transparancy" which just adds the properties of refraction instead of alpha transparency. And the extra parameters for this inbuilt as well (but only really used when that mode is selected) and allow for better glass or transparency in objects. This could also potentially be maintained over to the new system as well as the standard material should likely keep this in some way in a new version for simplicity...

Describe alternatives you've considered

Currently you can do this by stacking meshes, the only method I know at the very least. But this feels sorta "wrong" to do, as in every other program I work with, I have never had to stack meshes to utilize refraction before... It also makes it a little more fickle as you have to do more to make sure the refraction normal goes along with the normal on the visible material used on top for reflections when you make things like water. And the current refraction shader is limited in terms of assigning a standard texture and detail texture.

Additional Context

No response

Requesters

Zefnoly, wav3, Reviver

shiftyscales commented 5 days ago

Currently you can do this by stacking meshes, the only method I know at the very least. But this feels sorta "wrong" to do

Having separate mesh renderers and duplicating the mesh is currently the only intended / supported way of "stacking" materials. It might feel wrong- but it is the proper way to handle doing that- so you are doing the right thing based on what you describe here.

https://wiki.resonite.com/Things_to_Avoid#Material_%22Stacking%22