Mylar Brush Export Issues

Imported an FBX of my model in Unity direct and the mylar brush does not keep the same shape as it does in Open Brush (loses the taper of the brush stroke). That should say Unity up top. Can't edit the title.
85 Replies
Zandy
Zandy2y ago
I tried changing the brush type within Unity and it didnt solve the issue (single sided, double sided etc)
AncientWorlds
AncientWorlds2y ago
Default brush prefab is tube UV, is hooked up to MylarTube.shader. My impression is that it modifies the specular shader to do something tricky with reflection. Shader only takes an albedo directly and adds a squeeze amount variable. Not sure if its actually modifying the physical shape of the tube or just the surface lighting. Interestingly it doesn't use a blend mode in the asset export settings on the brush (unless I accidentally changed that). So not so much an answer, but might be useful info if its script related
AncientWorlds
AncientWorlds2y ago
AncientWorlds
AncientWorlds2y ago
If you make a duplicate brush and change the guid and brush prefab might be insightful.
**misread the above. You changed the brush type and used an fbx. Is it losing the script attachment as an fbx? Hmm
Zandy
Zandy2y ago
Just added Mylar material to the Mylar brush manually like I have to when importing fbx into unity. Glbs still don’t export for me. I played around with single/double because you have to do that with many of the single sided brushes or one side is transparent in Unity or doesn’t show the correct normals For example tapered marker will show squared edges instead of tapered. I wanted to see if it would change the Mylar as well but it didn’t
andybak
andybak2y ago
Oh. How come I've never noticed that before. I suspect Mylar is doing it's stuff via vertex shader magic which won't be reflected in the mesh itself. @mikesky - this is going to be annoying to fix - we'll have to special case stuff like this in the exporter. Gonna be fun porting the hlsl logic to C# If it wasn't for the fact that Mylar is one of my favourite experimental brushes, I'd be tempted to consign it to the bin of "experimental brushes that are too much work to support going forward" (I guess there must be a way to read vertex positions back out of the shader 🤔 )
Zandy
Zandy2y ago
It my fav too @andybak
andybak
andybak2y ago
So - places it will work are: 1. Unity via Toolkit/SDK 2. WebGL via our three.js loader. Anywhere else will have this issue currently.
mikesky
mikesky2y ago
Oh boy 😅 To be honest though, is this any different to other fancy brushes? They need the SDK to look right as well
andybak
andybak2y ago
Well - all the other brushes have meshes that correspond to how they look in the headset.
Zandy
Zandy2y ago
This is the only brush that I have encountered so far that I can't fix within unity settings.
andybak
andybak2y ago
this is the only case i know where the actual geometry differs from the exported one.
Zandy
Zandy2y ago
besides smoke etc.....
Zandy
Zandy2y ago
Hey @andybak Just checked my party world (9/2021) and the artcrypt world (10/2021) in vrc where I had mylar. Apparently it worked at one time. THose are showing as tapered. However, when I use it now on new builds it shows the same thickness throughout similar to the icing brush. So something must have changed between now and then in the build. Maybe its messing something up on export? I know it was the same issue with mylar as far back as jan 2022 because I also noticed it with my mona build (no taper). Based on the dates of the two worlds and mona, it must have been in a OB build somewhere in nov/dec 2021 where it broke.
andybak
andybak2y ago
How did you get that into VR Chat? Isn't that via Unity?
Zandy
Zandy2y ago
yes... all unity same with mona
andybak
andybak2y ago
So that will work. It's a different process Unity and three.js should be fine
Zandy
Zandy2y ago
Is the error in the export?
andybak
andybak2y ago
It's really an error as such. The shape of the mylar brush is partly created in the shader - so any pipeline that doesn't support custom vertex shaders won't show the shape. Currently custom shaders only work in a) Unity b) WebGL (but only if you use a custom loader) Blender's materials are totally different so will never be able to use our shaders - so we need to bake in the correct shape at export time. No other brush does this as far as I know. Animated brushes do something similar but only for the animated shape changes.
Zandy
Zandy2y ago
This is all in unity sorry about Blender in the title. I couldn’t change the title in the post. What would cause it to work before and not now?
andybak
andybak2y ago
Are you using the version of the SDK/Toolkit that has support for experimental brushes?
Zandy
Zandy2y ago
Yes always Has anything changed to it since 8/2021?
andybak
andybak2y ago
Can you zip up the Unity Assets, Packages and ProjectSettings folder and DM them to me? Not that I know of
Zandy
Zandy2y ago
For the model I just showed you?
andybak
andybak2y ago
Any project that has this problem and contains a mylar stroke
Zandy
Zandy2y ago
Sure I’ll send you a fresh one
andybak
andybak2y ago
Where do you download the SDK from? What's the url you use? Wait - you're using fbx with the SDK/Toolkit?
Zandy
Zandy2y ago
Yes
andybak
andybak2y ago
I just tried it - glb works fine. We stopped recommending fbx with the toolkit ages ago. Because it wasn't working
Zandy
Zandy2y ago
Still having export issues with the builds I’m using. Never generates a glb (0mb). Does this work in the new beta build Mike just pushed out? I can try again this am
andybak
andybak2y ago
I don't know why you're getting 0mb. Is this is an issue we've previously discussed? What was the resolution? My recollection was that we'd fixed those issues.
Zandy
Zandy2y ago
Yes. Same issue. Too many builds… gets confusing. I’ll go back to the beta on oculus and try again…. Or do #you want me to try on steam
andybak
andybak2y ago
Try on what you normally use. The point is - glb should work. If it doesn't we need a reproducible example so we can fix it.
Zandy
Zandy2y ago
Ok will give it a go this am. I’ll let you know how it goes within the hour
andybak
andybak2y ago
And if this relates to an earlier discussion that wasn't finished, a link to that would be handy.
Zandy
Zandy2y ago
Ok will do The Oculus Open Brush Beta doesn't have experimental brushes enabled. Using steam beta with experimentals now @andybak Glbs exports are not working out of beta - experimental on steam. The file renders nothing 0KB Reg beta pre release generates the GLB but mylar and waveform (both experimentals in the piece) did not show in the GLB, just the original TB brushes would show.
andybak
andybak2y ago
Ooooh these versions hurt my brain!
Zandy
Zandy2y ago
yes can we please condense them? Makes it easier for both of us
andybak
andybak2y ago
(we'd love to but that means merging experimental features to main - no other way to do it)
Zandy
Zandy2y ago
Why would the oculus beta not have experimentals?
andybak
andybak2y ago
It does - but not via the Oculus Store (because Oculus doesn't allow more than two versions) Grabbing the build from Github should work.
Zandy
Zandy2y ago
I used the drop down to select beta though
andybak
andybak2y ago
Beta and Experimental aren't the same thing. "Experimental" is an old Google thing we haven't got rid of yet.
Zandy
Zandy2y ago
youre really trying to get me confused now.....
andybak
andybak2y ago
I always refer to it as "Experimental Mode" just to distinguish it from other things
Zandy
Zandy2y ago
Im going by what is on steam and how it is labeled But its not labeled that way;)
andybak
andybak2y ago
? shall we put this naming discussion to one side for now? I want to get the glb thing clear
Glbs exports are not working out of beta - experimental on steam. The file renders nothing 0KB
OK. Can you send me the .tilt file?
Reg beta pre release generates the GLB but mylar and waveform did not show in the GLB
What is "reg beta pre release"?
Zandy
Zandy2y ago
andybak
andybak2y ago
one sec (There's a bit of a mixup on Steam. Prerelease and Beta mean the same thing. And they should be identical.) So - you need to be using "experimental beta" or "experimental prerelease" - they should be the same thing. (I'm going to remove one of them soon) So - if I try your sketch in that version - I should expect to see a 0kb glb, correct?
Zandy
Zandy2y ago
I used these two. Beta produced the glb but experimental brushes were not visible.
Zandy
Zandy2y ago
Zandy
Zandy2y ago
beta experimental did not produce a GLB at all.
andybak
andybak2y ago
Yes - ignore the first one OK - so. I think the version confusion is the cause of this.
andybak
andybak2y ago
We're going to clean this up but for now - switch to "prerelease experimental". I get a working glb export:
Zandy
Zandy2y ago
ok will do. Perfect! Taper shows in Unity as well as the DOTS! 🙌
Zandy
Zandy2y ago
andybak
andybak2y ago
And - even if you didn't intend to report the bug in Blender - it's a genuine bug that we wouldn't have spotted otherwise! (well - "sort-of bug"...)
Zandy
Zandy2y ago
Thanks so much for your help. will be using prerelease experimental for now as long as there is no issues in this version with the camera and color
andybak
andybak2y ago
One last question. You know in Steam where it tells you what version you're on:
andybak
andybak2y ago
If we rename the versions to be less confusing - there's one annoying side-effect. Anyone on the version we get rid of will get moved on to the normal release. My question is this: would you notice that label in Steam changing?
Zandy
Zandy2y ago
Under properties---> beta
andybak
andybak2y ago
Right here in the Library sidebar:
andybak
andybak2y ago
I'm just wondering how confusing it will be for people when they get switched to the normal release.
Zandy
Zandy2y ago
It shouldnt...Im seeing it show in the library like you
andybak
andybak2y ago
ok. we'll get rid of "prerelease" and keep just "beta" so look out for suddenly switching to the normal release when we do
Zandy
Zandy2y ago
super helpful what I have will stay the same though correct since its experimental?
andybak
andybak2y ago
no we're getting rid of all mentions of "prerelease" because "beta" is consistent with Oculus and other places we use the word so you'll be moved and you'll have to change back yourself
Zandy
Zandy2y ago
ok will the new title be just beta? or beta experimental? or just experimental? lol Why is this always like a who's on first skit?
andybak
andybak2y ago
beta just means "things we haven't released yet" experimental means "the stuff google wrote that isn't polished enough for the main release" we're going to get rid of experimental just as soon as we can make it polished enough (or remove the bits we can't)
Zandy
Zandy2y ago
noticed the glbs are larger file sizes too huh?
andybak
andybak2y ago
Shouldn't make a difference when you do a build
AncientWorlds
AncientWorlds2y ago
Curious, are bubbles working? ran into some kind of error involving version numbers when I was trying some things
Zandy
Zandy2y ago
Bubbles weee working will have to recheck. Biggest issues were dots, stars, embers, smoke. Looked like the png was the wrong shape
AncientWorlds
AncientWorlds2y ago
If they worked before, they probably still do, thanks.
Zandy
Zandy2y ago
Andy another quirky thing is happening with Mylar and I don’t know why. Started a new build and brought in mylar as a glb exported from the prerelease build and everything was perfect. As soon as I brought the same glb into a world that was already built I get the untapered version of the glb. Any idea what would cause this? It’s the same version of unity
andybak
andybak2y ago
You talking about bringing a glb into the Unity using the Toolkit/SDK ? Any console errors in the non-working case?
Zandy
Zandy2y ago
Yes I brought in the Mylar girl glb into unity using the same tbt and glb. One was a new build the other an existing one. Not sure re errors will check this am @andybak There were no errors in the console log.
andybak
andybak2y ago
All I can suggest is that you zip up the Assets. Packages and ProjectSettings folder and send me a copy
Zandy
Zandy2y ago
Thanks andy, It's just one piece though. I can try again on another build but its my entire gallery.
andybak
andybak2y ago
I just need one example so I can investigate
Zandy
Zandy2y ago
ok will create another but will have to be this weekend...hopefully the problem replicates there
AncientWorlds
AncientWorlds2y ago
I got sent one today and it appeared to be missing some elements that were in the scene picture, including all instances of the disco brush. Haven't confirmed whether the correct model was sent. Definitely possible that there are importer issues. Should know in a couple of days
Zandy
Zandy2y ago
This is just GLBs @ancientworlds ? I noticed that too with a model I imported yesterday.
AncientWorlds
AncientWorlds2y ago
It was a glb model. Fbx doesn't transport the animation data, just keeps the underlying geometry, at least within the game environment. Exports keep the albedo, last I checked. Think it may work differently within Unity at the top level, haven't explored that a lot. The imported model I saw was made in open brush, no idea which version, was possibly pre-XR.
Was filming a path and looking for a workaround to missing image files, which apparently got deleted. As expected, the glb retained them. Not my file so not sure what was done on the other end aside from the model I got was a glb model.