Multiple Textures for One Model


(Devlin Gandy) #1

Hello, I'm working on a series of murals, trying to create the layering of the paintings sequentially, as they built up over time to make the final mural. I'd love to be able to upload a model, then upload separate textures that the viewer could run through to see the additions to the mural over time. Is there any way to achieve this presently with Sketchfab?


Using Multiple Textures or Materials With Only One Model
(Bart) #2

Sounds like a new feature that @marc is working on. Care to tell us more, Marc? :smile:


(Shaderbytes) #3

Hi Devlin

It is possible to inject textures into the viewer at runtime using the sketchfab viewer API. The workflow to best do this is that each texture is not an individual layer but rather each texture is a combination of all the current layers for that step in the process. I hope that makes sense.

I am currently developing a Utility Javascript object that makes using the viewer API much more simple. Texture injection is actually next on my todo list.

I have an old sample page of doing texture injection , you can view it here :

http://www.shaderbytes.co.za/clients/hardheadveterans/sketchfab_api_dev/index.html

There are some additional things you have to do to get this working. Changes have to be made to the servers .htaccess to handle CORS.

Another issue is the page of the viewer should be using https , although if you use http it still works although it does report a warning in the console of the browser. As in the example above. I cant say for how long this functionality will last . Browser vendors may decide to escalate this warning into an error in the future.


(Shaderbytes) #4

AH yes that is correct bart. This new "stop motion" feature you guys are building could be used for this as well of coarse :wink: In fact it would be better since no changes to the server host need to be made .. and it can be displayed on sketchfab itself as is


(Mrchlblng) #5

@devlin_gandy you (currently) cannot switch textures on a static model without using the API. However, as mentioned by @bartv and @shaderbytes we've just released a simple feature to create simple animations from static models.
In your case, you'd have to generate one for each texture, zip all those models and add a file named sketchfab.timeframe.
Let's say you have mural1.obj/mtl/jpg, mural2.obj/mtl/jpg, mural3.obj/mtl/jpg, all you'd have to do is to put

0 mural1.obj
10 mural2.obj
20 mural3.obj

(the first column is a time in second and the second a model to display for that time)
in the sketchfab.timeframe file and it would create an animation, displaying one model after the other every 10 seconds.

Right now you cannot simply add a texture for a model so you really have to duplicate the geometry too (making the final output more heavy than necessary) but that's something we could improve.

Would you give that a try @devlin_gandy ?


(Devlin Gandy) #6

Thank you @bartv @shaderbytes @mrchlblng for the help and advice!

@shaderbytes , the texture injection is basically what I had in mind.
I'm curious to hear more about this stop motion feature

@mrchlblng that is very interesting and very useful for presentations. When I finish the layers for this model I will certainly try to upload it as you have suggested. That said, I do hope you can make an option for the viewer to be able to change the texture much in the same way the uploader can in the 3D settings. Maybe make it simpler, but nonetheless have that as a viewer option.

Thank you!


(Bart) #7

Hey @devlin_gandy, could you post the result of your experiments, even if it doesn't work as you want? It would be great feedback for us.

Thanks!


(Devlin Gandy) #8

Will do! I am a bit busy this moment and haven't had time to work on it, but hope to try later this week!