Glow maps?

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!
Post Reply
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Glow maps?

Post by Phitt »

I wonder how the glow effect on the 'talking heads' is done. The one where the eyes start to glow when you approach the heads. Is it some kind of glow map? A special material setting?
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Glow maps?

Post by Batty »

My guess is the eyes are one-sided and there's a two-sided eyeball mesh box in which they put a blue light source and used LightComponent:fadeIn(time) & LightComponent:fadeOut(time) to turn the eyes on/off but that's a guess. :oops:
User avatar
jxjxjf
Posts: 33
Joined: Fri Oct 24, 2014 6:26 am

Re: Glow maps?

Post by jxjxjf »

Yeah, they have 3 lights and use a function called setEmissiveColor().

setEmissiveColor() takes a vec, where the first three numbers in the vec are RGB values. The talking heads get that fade-in glow effect by quickly increasing the emissive color of the eyesModel over a short time from (0,0,0) RGB value, which emits no color.

It's fun to play around with, but unfortunately only brighter emissive colors cover up the texture of the eyesModel and give it that nice glowing effect, so you're really limited to a white or bright blue. :lol:
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Glow maps?

Post by Phitt »

Ah, setEmissive color looks nice, thanks. I assume you are 100% certain about the eyes being a stand-alone model and not the whole head statue using a glow map? No idea where you look for that, I could only look up a few things in the dat file using a hex editor, which is a pain.
User avatar
jxjxjf
Posts: 33
Joined: Fri Oct 24, 2014 6:26 am

Re: Glow maps?

Post by jxjxjf »

Yeah, you can see it under Components when you have the GameObject selected in the editor. It has one "eyesModel" for both eyes. You can test it by disabling the stonephilosophercontroller and using setEmissiveColor() yourself on the eyesModel. I'm not sure what the RGB value is for the blue they use, but each value seems to go from 0 to 1. If you do something like:

Code: Select all

head.eyesModel:setEmissiveColor(vec(1,1,1,0));
You'll get two white, "glowing" eyes, provided you disabled stonephilosophercontroller. Then you can change the color of the leftEyeLight, rightEyeLight and bounceLight to get the same glowing effect seen in game. Then you can hook it up to a floor_trigger and timer to increase brightness and emissive color gradually to get exactly the same effect.

I know all of this only because I was trying for a while to get it to "glow" dark. :lol: It doesn't work that way. :( :lol:
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Glow maps?

Post by Batty »

The eyes model, assets/models/env/beacon_furnace_head_eyes.model, looks like this in Blender:
SpoilerShow
Image
The head model, assets/models/env/beacon_furnace_head.model has two objects, the head:
SpoilerShow
Image
and the eyes:
SpoilerShow
Image
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: Glow maps?

Post by Phitt »

Uhm...how do you access the assets? I have no idea how to do that (unless I missed something and the asset pack was released somewhere already). I remember the dat extractor from Grimrock 1, but that one was frowned upon by the devs and I don't think there is a link to it anymore on the forum?

But thanks for the info, it's good to know there is emissive color at least (even though you need two models if you want to make only parts of a model glow).
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Glow maps?

Post by Batty »

I'm using bitcpy's importer from this thread.

It only seems to work with Blender 2.71 which is not the current version. Skuggs has been using it in his tutorials so I guess devs are OK with it... :) :?

Also, if you're not a Blender user, watch the Skuggs Breakable Walls Tutorial and it shows how to install the importer.

Edit: the importer works fine with newest Blender 2.72b, I had screwed up my install somehow.
Post Reply