Yellow-Dog-Man / Resonite-Issues

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

MainTexturePropertyBlock Does Not Work on Most Materials #1455

Open lxw404 opened 8 months ago

lxw404 commented 8 months ago

Describe the bug?

The MainTexturePropertyBlock is supposed to provide a way for re-using the same material with different main textures, however many materials that should probably work with it, currently do not.

These include:

Some other materials may benefit from the use of this property block, however it is not as directly clear what the MainTexture is in contrast to the above materials.

To Reproduce

Spawn this reproduction item: resrec:///U-LuxKitty/R-19D3EF202A5CDDB5D51C3ABBA96AE8ED7E323090403369EDEABFAFAC2C78C1B4

Observe that only a few materials exhibit the MainTexture from the property block.

Resonite_VEUvJ5r3kU

Expected behavior

All of the above listed materials should apply the MainTexture to their first texture input or alternatively the designated "Main" texture (for PBS this seems consistently to be the Albedo).

Screenshots

No response

Resonite Version Number

2024.3.1.1178

What Platforms does this occur on?

Windows

What headset if any do you use?

Valve Index, Desktop

Log Files

MainTexturePropertyBlock - MainTexture - 2024.3.1.1178 - 2024-03-07 07_40_05.log

Additional Context

No response

Reporters

LuxKitty

lxw404 commented 8 months ago

This behavior is the same in the MainAndMaskTexturePropertyBlock as well wherein its MainTexture has no effect on the same materials.

XDelta commented 8 months ago

A few of these at least just don't have a MainTexture Property. In the case of FresnelMaterial, it has _NearTex and _FarTex Properties but neither is a MainTexture (_MainTex), either needing a PropertyBlock for that specific pattern of Near/Far or something more generalized to handle more scenarios.

Frooxius commented 8 months ago

This is not a bug, it is not expected to work with most materials - it's been designed to work with a particular subset of them.

Some of them we can extend to add the support. Some of them this property block would be meaningless, like mentioned - say FresnelMaterial, because it doesn't have main texture.

lxw404 commented 8 months ago

Fresnel I understand is a bit less straightforward. Barring this, the remaining 10 seem to be aligned with the ones that do work.

For the rest that are listed above:

I'd hopefully expect ones that match up 1:1 like these should behave similarly.