Question on animation textures

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: Question on animation textures

Post by Isaac »

minmay wrote:Isaac, if you only want differing colours, why are you messing with a bunch of hacks and different materials when you could just use one greyscale texture and ModelComponent:setEmissiveColor()?
Lack of familiarity of course. ;)
*That's a welcome tip... I was looking at it as a general thing, but it's true that this problem seems crystal specific. Do you know of a way to animate the fade? (I'm wondering if the emission brightness can be animated in the onDrawGui hook.)

It does wash it out though:
SpoilerShow
Image
Turning on ambientOcclusion does restore (add) some faked shadows, that raises the contrast back up a bit.
SpoilerShow
Image
Aha! Negative color values restore the highlights, that and a more contrasted diffuse image improve it greatly. Low enough negative values can also make it black; so I think it can be animated to fade when used.
SpoilerShow
Image
Last edited by Isaac on Wed Apr 25, 2018 5:56 pm, edited 1 time in total.
minmay
Posts: 2788
Joined: Mon Sep 23, 2013 2:24 am

Re: Question on animation textures

Post by minmay »

You fade emissive colours by changing them every frame. It's what StonePhilosopherControllerComponent does for the glowing eyes.
Don't do anything like that in onDrawGui! That hook isn't called when the normal GUI is disabled, such as when the party is free-looking. Use TimerComponents or onUpdate hooks for every-frame stuff.

As for washed out colours, you're using values that are too extreme. Keep in mind that CrystalComponent adds some blue tinge itself, and that negative values are supported. Also, you may want different emissive colours for when the crystal is charged or not (you can easily check whether it's charged by checking whether the CrystalComponent is enabled, and keep track of the fade in/out part with a TimerComponent).

Also, I've looked into it and while there are many ways to change the material of a healing crystal, the CrystalComponent's special effects only apply to the healing_crystal material. You won't get the blue tinge, brightness/sparkliness and fading in/out with any other material. So you probably want to stick with healing_crystal.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Isaac
Posts: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: Question on animation textures

Post by Isaac »

minmay wrote: That hook isn't called when the normal GUI is disabled, such as when the party is free-looking.
This I've seen in action. I have a rising platform script that I will alter to use the Timer. 8-)

Thanks for the advice minmay.
Post Reply