- This topic has 11 replies, 3 voices, and was last updated 1 year, 3 months ago by vision.
-
AuthorPosts
-
2023-08-16 at 4:14 pm #66196visionCustomer
My menu consists of 3 textures replacements on the object.
Which texture is the current one (and should be replaced) is kept in a variable “current_texture”.But my logic only works the first time when a texture is replaced, after that all options don’t work no more.
Any ideas?
Attachments:
You must be logged in to view attached files.2023-08-16 at 6:14 pm #66204xeonCustomerOK so you can actually do this with textures. Keep the original texture name in the replace texture puzzle. Do not change that with the variable you have now.
- This reply was modified 1 year, 3 months ago by xeon.
- This reply was modified 1 year, 3 months ago by xeon.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2023-08-16 at 6:30 pm #66206kdvParticipantTexture names remain unchanged after any replacement. No need to use variables in this case.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-17 at 7:36 pm #66217visionCustomerTexture names remain unchanged after any replacement. No need to use variables in this case.
The variable is used for keeping track of which texture (or material) needs to be replaced.
Since the outcome of the last selected option in menu material is the one that needs to be replaced.Is there a way to use a puzzle to replace a texture (or material) without the name of the texture-to-replace being known/used in the puzzle?
2023-08-17 at 8:15 pm #66218kdvParticipantOnce again: names of textures remain unchanged. In you case it was enough to use this construction
Texture’s images will be replaced, texture’s names will remain the same.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-17 at 8:28 pm #66223visionCustomerAnd in case of the replace material puzzle? When a color is chozen for the object, it needs to replace the previous material that was chosen.
It can not me a static material in the replace texture slot, because it depends on the last material chosen.2023-08-17 at 8:31 pm #66224kdvParticipantbecause it depends on the last material chosen.
In you example you used the same material. For different materials logic will be different. Think. Test.
You could easily modify materials of your multi-material cube without replacing materials, just by replacing textures in materials. Or you could split you cube in Blender “one mesh – one material”. But you’ve chosen to replace materials. Ok. But why do you need to replace textures in replaced materials?
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-18 at 11:45 am #66233visionCustomeryes, I see that my questions are a little fragmented/confusing.
The full info for my AR-app:
I have a cube which I want to show in 20 colors and 10 textures.
I think it is better for load times if there are only 2 materials (instead of 30), and I make adjustments within those 2 materials.Materials:
The textures setup consists of 3 materials, assigned to respectively: top-bottom, left-right, front-rear of cube.
The color setup is BSDF of which I change the RGB values via puzzles, assigned to all of cube.Changes:
So when loading texture material, next step is to load the specific texture.
And when loading color material, next step is RGB vaules are changed for the specific color.Problems:
But when changing from a texture to a color material I think the assignment information is lost. So in the next change to a texture material there is assignment info for top-bottom, left-right, front-rear face assignment.I have already tested some options, of colors and textures setup, but because of AR/glTF2.0 requirements, the flexibility options (automate via shader, etc) are limited.
2023-08-18 at 4:45 pm #66235xeonCustomerIs your cube a single object or is it 6 individual planes?
If its a single object are you using one UV map or multiple?Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2023-08-18 at 5:19 pm #66236visionCustomerIs your cube a single object or is it 6 individual planes?
cube is single object
If its a single object are you using one UV map or multiple?
Not using uv although it has 1 uv map, BUT am using texture coordinate object mapping (blender). I need this for my object.
2023-08-18 at 7:45 pm #66239kdvParticipantBUT am using texture coordinate object mapping (blender)
But it’s not supported by standard materials required for AR in iOS. USDZ exporter supports PBR materials and UV coordanates only. PBR materials (aka gltf 2.0 compatible or standard materials) also support only UV coordinates.
I think it is better for load times if there are only 2 materials
2 materials are not enough for an object with three sub-meshes. You need 3 color materials and three texture materials. And two puzzles: “set color” and “replace texture”. That’s enough to get any combination of colors/textures on the cube’s sides.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-19 at 4:55 pm #66249visionCustomerok, thxs for the response, it is working now!
-
AuthorPosts
- You must be logged in to reply to this topic.