• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Question Packaging Var files and with plugin referencing SELF:/Custom pathing issues

Metix

Well-known member
Joined
Dec 5, 2022
Messages
85
Solutions
1
Reactions
304
I'm having some problems making a new package, specifically with references to loose texture files that are refences by a plugin. Also to note, the plugin is inside of a sub-scene that I am adding to the package, not sure if that makes a difference or not.

The plugin that I'm using is the Light Texture plugin. I soon realized that that textures it pulls from need to be in a specific directory ../Custom/Atom/LightTextures/.., So all my of custom textures have been moved there.

In the package manager, I add the scene.json file, then add the subscene.json file and then add the /LightTextures as a directory, as I'm including a number of additional textures as options. The package builds fine with no red missing files, but when I load it up in a clean instance of VaM, the var is stuck trying to reference the textures in SELF:/Custom.. Not varname.var/custom...

Is there any way in the package manager to force these references to use any path available? i.e. the var pathing as well? Or do I need to edit the JSON in the var itself to aim towards the textures packaged into the var?


Untitled-1.jpg

This is what the plugin pathing looks like from the ..save/scenes/ directory, note the SELF:/Custom pathing. In the packaged var this pathing does not get converted to the var pathing at all:

Untitled-4.jpg

Here's the error running the new var on a clean instance of VaM, still pointing at SELF:/Custom. I have verified that the textures are all in the right place inside the var.

Thanks!
 
Last edited:
Solution
It's probably not a reference issue, but a plugin issue.
  1. Plugins need to handle subscenes, maybe this one (like probably a bunch) does not
  2. "self" is the proper way of referencing local (to the var) files, but addressing custom files to convert to realtime assets requires testing, which might not be the case with this old plugin
It's probably not a reference issue, but a plugin issue.
  1. Plugins need to handle subscenes, maybe this one (like probably a bunch) does not
  2. "self" is the proper way of referencing local (to the var) files, but addressing custom files to convert to realtime assets requires testing, which might not be the case with this old plugin
 
Upvote 0
Solution
It's probably not a reference issue, but a plugin issue.
  1. Plugins need to handle subscenes, maybe this one (like probably a bunch) does not
  2. "self" is the proper way of referencing local (to the var) files, but addressing custom files to convert to realtime assets requires testing, which might not be the case with this old plugin

Okay, got it. Thanks again Hazmhox. While I can wish to create a perfect resource, I'll just have to use a load trigger to point the plugin at the desired texture, and then explain in the resource description how to use the subscene.

So it goes.
 
Upvote 0
Okay, got it. Thanks again Hazmhox. While I can wish to create a perfect resource, I'll just have to use a load trigger to point the plugin at the desired texture, and then explain in the resource description how to use the subscene.

So it goes.

What are you trying to achieve with the cookie thing?
That resource is bugged on the edges, I fixed the implementation in my VAMStoryVFX. Do you want me to check if I can implement a caustics one in it?
 
Upvote 0
What are you trying to achieve with the cookie thing?
That resource is bugged on the edges, I fixed the implementation in my VAMStoryVFX. Do you want me to check if I can implement a caustics one in it?
Oh wow, didn't know that VAMstory had support for light textures. Let me poke around in it to see if I can reproduce how I'm using Light Texture.

The Light texture plugin is working just fine for how I'm using it, with two directional lights moving in opposite directions.
 
Upvote 0
Oh wow, didn't know that VAMstory had support for light textures. Let me poke around in it to see if I can reproduce how I'm using Light Texture.

The Light texture plugin is working just fine for how I'm using it, with two directional lights moving in opposite directions.

You can't shoot custom maps in my version. The reason behind that is because textures for light cookies needs to be compiled a certain way, and I could not figure out a way to make it work with custom textures. Hence why I'm asking : )
 
Upvote 0
You can't shoot custom maps in my version. The reason behind that is because textures for light cookies needs to be compiled a certain way, and I could not figure out a way to make it work with custom textures. Hence why I'm asking : )

Yeah, after checking it out it won't work with how I'm using it. I'm running two directional lights and need to be able to load a custom tiled texture for it to work. You might take a look at LFE's source code for inspiration on how to implement custom textures, at least for how to map them to different light styles. They even using a script-built cubemap for the point light.
 
Upvote 0
Would having the textures already loaded in the scene make any difference? Maybe image panels or iscube faces under the floor?
 
Upvote 0
Yeah, after checking it out it won't work with how I'm using it. I'm running two directional lights and need to be able to load a custom tiled texture for it to work. You might take a look at LFE's source code for inspiration on how to implement custom textures, at least for how to map them to different light styles. They even using a script-built cubemap for the point light.

I exactly know how to make custom texture, I told you in the post you're quoting why I didn't :p
It's not a question of loading the texture, it's a question of proper compilation of the final texture which does not work at runtime since you need specific mip maps settings.
 
Upvote 0
I exactly know how to make custom texture, I told you in the post you're quoting why I didn't :p
It's not a question of loading the texture, it's a question of proper compilation of the final texture which does not work at runtime since you need specific mip maps settings.

Sorry, I'm not super versed on the vagaries of rendering pipelines and shaders. I usually manage to learn just enough to get the thing I'm trying to make work... well, work. So a little knowledge about a lot of stuff. Anyhow, here's a video of what I've been working on. It took about a week to figure out how to make it work within the limitations of VaM, but I'm happy with the results (though it has its limitations too) and want to share it as a separate resource, not just in the scene I made it for (underwater).

If you want any more ideas for VFX plugins that I found would have been super handy in this particular case, just let me know. Things like dynamic UV offsetting, and I know that cookies don't really use UVs, being able to offset the cookie texture with a slider would have been really helpful. I'm having to transform the loc and rot of several axes to get this effect. I did find that
Code:
Material.SetTextureOffset
is within the monocontroller, so VaM should support it at least for normal materials.
 

Attachments

  • causticwater.mp4
    15.4 MB
Upvote 0
Would having the textures already loaded in the scene make any difference? Maybe image panels or iscube faces under the floor?
Interesting idea, maybe essentially pre-caching them would do the job. But ultimately I realized that the if the problem has to do with the plugin itself being in a subscene, if I released that subscene as a resource, anyone who uses it in the future would end up facing the same problem I am right now. And I'm trying to be responsible, especially if releasing something designed for reuse by other creators.

@atani Helped me find a better solution: save what would have been the subscene as a regular scene and instruct in order to bring it into your scene to use merge-load-scene. This actually seems to work, if not quite as elegant in practice as I hoped a subscene would be.
 
Upvote 0
If you want any more ideas for VFX plugins that I found would have been super handy in this particular case, just let me know. Things like dynamic UV offsetting, and I know that cookies don't really use UVs, being able to offset the cookie texture with a slider would have been really helpful. I'm having to transform the loc and rot of several axes to get this effect. I did find that
Code:
Material.SetTextureOffset
is within the monocontroller, so VaM should support it at least for normal materials.

I think you'd need to try the shader/material yourself to understand that pretty much nothing is just not as simple as knowing a class parameter and setting it ;)


@atani Helped me find a better solution: save what would have been the subscene as a regular scene and instruct in order to bring it into your scene to use merge-load-scene. This actually seems to work, if not quite as elegant in practice as I hoped a subscene would be.

Honestly, I don't know why everyone overcomplicate things.
Having tested dozens and dozens of things in VAM, I can say easily that subscenes and merges and stuffs like these are pretty much never used.

If you want to share light presets even with complex plugins setups. Create a set of assets (your textures for instance). Create your light presets. Save both your assets and light presets in the scene. Document the release to explain to people "add your light, load preset X". Boom, done.

Nothing complicated, no subscenes, no merge, no nothing complicated nobody won't use just because most people don't really get used to complex implementations in VAM.
 
Upvote 0
I think you'd need to try the shader/material yourself to understand that pretty much nothing is just not as simple as knowing a class parameter and setting it ;)




Honestly, I don't know why everyone overcomplicate things.
Having tested dozens and dozens of things in VAM, I can say easily that subscenes and merges and stuffs like these are pretty much never used.

If you want to share light presets even with complex plugins setups. Create a set of assets (your textures for instance). Create your light presets. Save both your assets and light presets in the scene. Document the release to explain to people "add your light, load preset X". Boom, done.

Nothing complicated, no subscenes, no merge, no nothing complicated nobody won't use just because most people don't really get used to complex implementations in VAM.

Honestly, I'm trying to make this caustic water sim as plug and play as possible. There's a lot more to it than just lighting presets and few textures. I've ended up with five atoms (one a controller) working in concert, four of them moving at a constant rate on different axes, while maintaining synchronized pos and rot, and timing synched as well. It's already a complex thing and getting more complicated than it needs to be for two reasons, the plugin is not behaving, and I'm not confident enough with Unity scripting and C# to set down to write a rather complicated plugin for a relatively niche thing. At this point I'll likely just end up keeping it as a part of the main scene without making a separate resource.

Thanks for the help though, there are a lot of nuances to VaM that are not readily apparent and can be hard to track down. 🙏
 
Upvote 0
Yeah I get what you mean!

It's hard when it comes to creations that goes beyond the simple "plugin" (or similar). To give you an idea, HZMDemos contains dozens of tutorials with complex setups you can look at and use for your scenes. I've pretty much never seen anybody use that kind of complex setups.

95% of questions I have are simple "how do we enable this", which is documented (or litterally in the tutorial ) and a simple checkbox in a plugin most of the time. So this gives you the average attention span of people. I had even some people asking me some stuffs about features that have Alert windows right up your face telling you "do this / don't do that".

So the best possible way to share something complex is having a straight forward plugin with controls and nothing more... for most users.
Only a handful of very advanced creators will find your ideas interesting even if complicated (several atoms/controllers).

Beyond that, always share your cool things, everyone loves cool things ;)
 
Upvote 0
Back
Top Bottom