Custom Light
-
Emera Nova
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Custom Light
Which .lua file is needed to be edited to create your own light sources of different intensities and colours? Looking around the assests folder and I thought I found it but when I edited one of the files nothing ended up happening.
-
Emera Nova
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Custom Light
I managed to find the files needed to change the colours of the lights and what not but now I'm stuck on a different problem. I'm wanting to make the healing crystal match the colour of the area that it's in. I can change the light it gives off and the fog but the model itself doesn't seem to ever change from blue. Any ways around this?
Re: Custom Light
I guess you have to use a different material if you want something different than blue.
actually, the healing crystal use "textures/env/healing_crystal_dif" as diffuse texture, so he will never change colour.
but you can try this with less ressource:
make a new crystal model that use a copy of the crystal material definition.
e.g:
make a 8x8 dds texture or more of the color you want (like the black one, assets/textures/common/black.tga"),
then add this line to the material definition of the healing crystal:
not sure if this is the best way, but, depending the color, you can have a mix of the 1st diffuse texture and the new one. Just try if the effect is good.
if not, then you will need to make a new texture for the crystal.
actually, the healing crystal use "textures/env/healing_crystal_dif" as diffuse texture, so he will never change colour.
but you can try this with less ressource:
make a new crystal model that use a copy of the crystal material definition.
e.g:
SpoilerShow
Code: Select all
defineMaterial{
name = "my_new_healing_crystal",
diffuseMap = "assets/textures/env/healing_crystal_dif.tga",
specularMap = "assets/textures/env/healing_crystal_dif.tga",
normalMap = "assets/textures/env/healing_crystal_normal.tga",
doubleSided = false,
lighting = true,
ambientOcclusion = false,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 20,
depthBias = 0,
-- custom shader
shader = "crystal",
shadeTex = "assets/textures/env/healing_crystal_shadetex.tga",
shadeTexAngle = 0,
crystalIntensity = 3,
onUpdate = function(self, time)
self:setParam("shadeTexAngle", time*0.8)
end,
}
then add this line to the material definition of the healing crystal:
SpoilerShow
Code: Select all
emissiveMap = "mod_assets/textures/my_colored_texture.tga",if not, then you will need to make a new texture for the crystal.
Re: Custom Light
Use ModelComponent's emissiveColor field instead of making single-color emissive maps. Note that green and red versions of the healing crystal shadeTex already exist: green_slime_shadetex.dds and red_gem_shadetex.dds if I recall correctly. I don't think you'll be able to get a really good-looking color change without making a different diffuse map, though. Unless you count inverting the colours of the entire world by setting the sky's tonemap saturation to -1 
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Custom Light
this can be very fun! 