• Hello Guest!

    We have recently updated our Site Policies regarding the use of Non Commercial content within Paid Content posts. Please read the new policy here.

    An offical announcement about this new policy can be read on our Discord.

    ~The VaMHub Moderation Team
  • Hello Guest!

    We posted an announcment regarding upcoming changes to Paid Content submissions.

    Please see this thread for more information.

Light Texture Plugin

Plugins Light Texture Plugin 9

lfe

Well-known member
Featured Contributor
Messages
190
Reactions
1,450
Points
93
lfe submitted a new resource:

Light Texture Plugin - because bat symbols would be fun

😍 Like this? Consider gifting the community a creation in my name or even a private gift to me.
* I choose not to have a Patreon (love all you who do)

Light Texture Plugin

This will let you access Unity's ability to add image textures to lights. Unity calls these textures "cookies".


Spotlight - supported
Directional - supported
Point - not yet supported * I need to figure out how to work with cubemaps....

Read more about this resource...
 
Hi @lfe ! Hey this plugin's going to be amazing. I have a few ideas if you'd like, all pretty minor but they could make a difference:

1. You said only the alpha channel matters, right? If it's the case, I'd suggest using the other layers so we can _see_ what the light will look like when browsing textures, e.g. fill the blue layer (or copy the alpha layer to the blue layer, I'm not sure how VaM handles transparency in the thumbnails browser)
2. I think a few more cookies would be great, since most people will use what you have. My very simple ideas: gradient (full), gradient (thin), horizontal line, stripes (e.g. curtains or prison bars depending on the angle and distance), leaves (e.g. https://www.textures.com/download/trees0046/53493) and cloth (e.g. lamp shade). Obviously nothing that requires building something complex but those should allow for almost all "typical" uses.
3. This one's a bonus really, but since you know what textures you have built-in, you could add a drop down to quickly see all options using the scrollable popup.

I'm in love with this plugin and I'll probably start using it everywhere, and I'm sure many others will! Thanks for making this great idea so easy to use!
 
Actually, another suggestion...

4. Specify a folder for browsing, e.g. Custom\Atom\InvisibleLight\Textures so when you browse for textures, you will easily see which var files actually contain some.
5. I didn't have time to check yet so if it's done ignore it... If I browse for a texture and I want to "var" my scene, the path will change. And I'm kind of screwed because if I package, the path will change, but to change the path I need to package... so I kind of have to package, unzip, find & replace, and re-zip :D I know you can use "SELF:/" to make sure dependencies are packaged, so that would be a simple prepend to make cookie automatically packageable.

Sorry I got excited :)
 
Thank you for the feedback @Acid Bubbles . I really like to make things better.

Suggestions 1-4, 6 are pretty easy to fix.

Number 5 had me thinking tho. I have not had to solve the packaging VAC/VAR of some file that you just random by string in some custom JSONStorable. For example, if I reference some filesystem path in a custom JSONStorable, I do not know how to tell VAM that this is a file and not some other string, to make sure it gets in the packaing process. Are you saying that if you prepend "SELF:/" vam will pick up on this?
 
I _think_ it will, at least I know that VaM picks it up when browsing for dependencies, so it's worth trying out... otherwise I'm sure some other plugins creators had to deal with that at some point.
 
I think I found a bug (didn't confirm but since I had the same issue before I expect that's it), you use the default file browser instead of the media browser to load images, so after you load a texture, you cannot load a scene anymore :D If you can reproduce as easily as this too, check out collider editor, snug or timeline's import function if you need a reference on how to do it (snug is a single file so it will be easier to find!)
 
I think I found a bug (didn't confirm but since I had the same issue before I expect that's it), you use the default file browser instead of the media browser to load images, so after you load a texture, you cannot load a scene anymore :D If you can reproduce as easily as this too, check out collider editor, snug or timeline's import function if you need a reference on how to do it (snug is a single file so it will be easier to find!)

Thanks. Yes there is definitely something odd with the file browser code I have set up. That is the first thing I will look into. Someone else messaged me about that as well.
 
There is definitely something odd with the file browser. After using the plugin using the VAM Open Scene button thinks it is looking for plugins so no scenes will show up. Hard reset won't fix it, only close VAM and reopen will do it
 
There is definitely something odd with the file browser. After using the plugin using the VAM Open Scene button thinks it is looking for plugins so no scenes will show up. Hard reset won't fix it, only close VAM and reopen will do it

I can reproduce it pretty consistently yeah. I have a fix for it almost done and will try and release it soon.
 
@Acid Bubbles and @Spacedog , the fix is in place for the Light Texture plugin.

Oh, and Acid I tried my hand at doing some more textures like lines and leaves and such. It turns out I just suck at paint programs so I'll take any contributions and roll them in but I'm just going to stick to code.
 
Working great now. One thing I noticed for the spot light is there is a strip of light bleeding through at 90 degrees from where the light is pointing. It seems to happen with all the textures apart from supernova 2.
 
Working great now. One thing I noticed for the spot light is there is a strip of light bleeding through at 90 degrees from where the light is pointing. It seems to happen with all the textures apart from supernova 2.

Oh well that is frustrating.

In the next couple of days I will take a look. There is probably something special you have to do when making these textures that I am missing, size, bit depth, max circular size or something like that.

We will get there.
 
I've been experimenting with textures and some give me errors for some reason...

1596390345229.png


leaves.png


I didn't have time to search on my own yet, let me know if you have an idea!
 
Th
I've been experimenting with textures and some give me errors for some reason...

View attachment 5555

View attachment 5557

I didn't have time to search on my own yet, let me know if you have an idea!

Thanks, I will have some time to look tomorrow. Just a gut feeling, maybe because the texture is not square? I have not even tried with rectangular textures yet.
 
AH wait it's not a power of two :| That's probably the issue (I hoped I'd write that before you saw the message :D)

This being said, it would be good for newbies to detect when that object is null and instead throw an error like "Invalid image, make sure it's square and a power of 2" :)
 
Y
AH wait it's not a power of two :| That's probably the issue (I hoped I'd write that before you saw the message :D)

This being said, it would be good for newbies to detect when that object is null and instead throw an error like "Invalid image, make sure it's square and a power of 2" :)

Yeah, at least that. Maybe even a warning and an attempt to crop blindly.

Another quality of life feature I am considering is grayscale to alpha checkbox.
 
Well I'm still disappointed I don't have Photoshop built-in to make pixel corrections, but it's pretty nice anyway :)

But seriously invert's going to be useful since it means any image can work as-is, the brightness too (e.g. I found that my blinds had way too much contrast, now I don't even have to fire Gimp!)
 
Back
Top Bottom