Open kfarr opened 10 months ago
Here is an existing method that does this for separator type segments: https://github.com/3DStreet/3dstreet/blob/main/src/aframe-streetmix-parsers.js#L688
If done correctly the new component proposed in this ticket should be able to replace the use of repeat: ${repeatCount[0]} ${repeatCount[1]}
within the streetmix json parsing function
I did this option with repeat last year. So it will be easier for me to implement this method
Issue: Textures appear too large, too small or squished in some cases for ground in building lots or ground for street segments.
Cause: When applying textures to ground box or segment box the repeat values are dependent upon the user supplied length, width, depth, etc. of the underlying geometry (plane or box)
Workaround: A user can manually modify assets.js material code to change texture repeat values.
Instead: we should have a mechanism for a-frame to define a texture for a geometry such that the material automatically sets a repeat value as to maintain the original aspect ratio and resolution of an image. (perhaps there is a new property that can be passed to specify the relative scaling from the original resolution as a number)
How would this be applied?
magic-material
componentfixed-repeat
that will listen to updates to geometry and automatically update the materialrepeat
valueCurrent:
<a-mixin shadow id="ground-parking-lot-material" material="src:#parking-lot-texture;repeat:.5 2;roughness:${surfacesRoughness}"></a-mixin>
Instead, example syntax:
<a-mixin shadow id="ground-parking-lot-material" fixed-repeat material="src:#parking-lot-texture;roughness:${surfacesRoughness}"></a-mixin>
and the fixed-repeat component automatically calculates material repeat value based on dimensions of box or plane (no other geometry primitive value supported?)