• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. 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.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
Caustic Lighting Rig

Lighting + HDRI Caustic Lighting Rig

Download [4.49 MB]
This is a subscene for a lighting rig to simulate caustic lighting, generally for use in underwater environments.
Should be pretty simple to use, but there are some caveats.


Simply add the CausticLighting subscene to your scene and it should start working out of the box. The trouble starts if/when you try to package it into a VAR file. If you only want to use this locally then you shouldn't have any problems and can begin customizing, or use as is, right out of the box.


If you want to see what can be achieved with this rig, check out my Yalby's SIren Song scene for a full tech demo.








Notes:

The lights in this subscene are attached to directional lights. The Light Texture plugin does support point and spot lights, but due to how I had to fenagle these lights to work, it will really only work on directional lights for now. Until someone creates a plugin, specifically for projected light textures, that allows for dynamic UV offsets, then this is the case. Know about the directional lights if you want to use this rig, as it can change how you handle lighting in your scene.


If you want to change the direction of the lights, everything is parented to the CausticController Atom. So just drag and rotate that around to see what different angles might look like, depending on the environment you're working with, different angles might look better.


The other issue if using this rig, is that it will eat up two of your pixel lights. So if your scene is dependent on a bunch of lights you'll have to make some compromises or get really creative with spot lights.


I have included a variety of caustic textures for you to play around with. Different effects can be created with different combinations of textures. Figuring out how to get this to work within the confines of VaM too quite a bit of trial and error. I found that best results come from having two nearly identical textures moving in exact opposite directions seems to yield the best results. For some variation I've also attached some Perlin noise generators for rotation on pivot atoms. They are disabled by default, but you can turn them on, tweak their values and see if you like the results.



Problems when trying to package this rig into a VAR file, and how to solve them:
If you aren't going to package this then you can ignore the directions below.


This plugin relies heavily on the Light Texture plugin by @lfe. It's pretty neat, but unfortunately has some intractable issues when it comes to packaging it into a VAR file. Unfortunately this is currently the only plugin of its type that allows for the addition of custom projected light textures, I know Hazmhox is on the case though.


This process will likely take several attempts to get just right. But then it wouldn't be VaM if it worked on the first try!

  • Once you get your lights set up just how you like, go to each of them and save off an invisible light preset for both of them. You will need to pull these presets into your package.
  • Now you will also need to add an onSceneLoad trigger of some sort. You can either use @MacGruber's load trigger from logic bricks, or @Captain Varghoss's load trigger (this is the one I mostly use).
  • I have included a Load Trigger in the subscene, you can use it or make one of your own. The plugin is located in the 'CausticController' Atom, and is at the bottom of the list. Please check it for reference.
  • In the load trigger you will need to set the presets you just made to each light. This will happen on scene load. Test loading your scene to make sure its functioning properly, if it is then nothing should look any different.

Now you can package your scene. The next step involves opening the VAR file you just packaged and editing the JSON files for each of these presets you just made.


The edit is pretty simple. We're going to hardcode the pathing to the custom texture map, removing the SELF designator with the package name containing the texture file.

  • Open the var file and locate the presets.
  • Open them in your code editor of choice (I recommend VS Code or something like Notepad++).
  • Now find the line that looks similar to the one in the screenshot below, note the highlighted SELF path.

1760351963030.png



Now replace SELF with the full name of your package, including the version number, but don't add the .var extension. See the highlight below:



1760351974340.png



Do this for both presets. Now launch VaM and load your packaged scene. NOTE: If your custom textures are also loose files in your '/custom' directory then it will seem like nothing is wrong. You need to do this editing in a clean VaM install, which I highly recommend for testing newly packaged VAR files in general.


NOTE: All of this is also true if the path says .latest instead of SELF as well.


Also, I mentioned earlier that this will probably take several attempts to get right. I figured this out and it still takes me 4 or 5 times to get it right. VaM often wants to change your pathing when making and packaging scenes to make things more robust and streamlined, but for anomalous stuff like this it can get in the way at times.



Special thank you to @supperGR and his Slut Showroom scene, especially his underwater set, for inspiring me to dive into this. Which also requires a special thanks to @ptrxxx and their Simple Photo Scenes for inspiring @supperGR in their scene.

And to all of the amazing plugin and content makers who allow VaM do things on the daily that it was never intended to. The community wouldn't be the same without you, and VaM would be far the worse for it.



Enjoy, best of luck, and may you all enjoy good lighting!



.
React to this content...

More resources from Metix

Click the links below to support the other creators whose content was used to make this resource!

Share this resource

Credits

Creator Support Link
Captain Varghoss Captain Varghoss
HAL9001 HAL9001
K ky1001
lfe lfe
MacGruber MacGruber
Voithe Voithe

Latest updates

  1. Fixed bad version

    Uploaded the wrong file last update. Fixed
  2. Fixed bad JSON edit. Warnings removed

    Left a bad JSON edit in the first version. Warning errors should now be removed.
Back
Top Bottom