Sky outside / normal lighting inside?
Sky outside / normal lighting inside?
Is it possible to create a level that's a true interior dungeon, but with an outside area that has a true sky?
I was looking at the possibility of having windows in my dungeon that look out onto a skybox. Obviously if I place a standard sky item in the level, it changes all the lighting across the entire map which makes the dungeon areas look brightly lit. Not good.
I looked at possibly building the dungeon out of wall/floor objects, but it's not really a viable solution for a whole level.
I was looking at the possibility of having windows in my dungeon that look out onto a skybox. Obviously if I place a standard sky item in the level, it changes all the lighting across the entire map which makes the dungeon areas look brightly lit. Not good.
I looked at possibly building the dungeon out of wall/floor objects, but it's not really a viable solution for a whole level.
Re: Sky outside / normal lighting inside?
What do you mean by 'true interior'?
Have you tried using a script_entity that spawns the entire interior room(s)?
(Alternatively, it could be a script entity that self creates model components, and offsets them; for the walls, floors, and ceilings.)
I've done this with scripts that spawn and reposition 20 models, and placed several of the scripts on the map ~each spawning its collection.
*For loops work great in a script like this.
** It doesn't technically have to be a script entity... The code can be in the onInit hook of any component... even a Null.
Have you tried using a script_entity that spawns the entire interior room(s)?
(Alternatively, it could be a script entity that self creates model components, and offsets them; for the walls, floors, and ceilings.)
I've done this with scripts that spawn and reposition 20 models, and placed several of the scripts on the map ~each spawning its collection.
*For loops work great in a script like this.
** It doesn't technically have to be a script entity... The code can be in the onInit hook of any component... even a Null.
Re: Sky outside / normal lighting inside?
have you tried just disable / enable some of the sky components when party crossing between interior / outerior areas ?
Re: Sky outside / normal lighting inside?
@Issac: By true interior, I mean the floors/walls built using the tile painting tools, rather than placing everything by hand or script. In addition, interior levels (those without a sky object on them) have different ambient light behaviour, no fogging or cast shadows etc.
@Drakkan: Good point, I'll try that out. Thanks.
EDIT: There is actually an unused castle window model in the asset pack. Looks like the devs had the same idea but abandoned it.
@Drakkan: Good point, I'll try that out. Thanks.
EDIT: There is actually an unused castle window model in the asset pack. Looks like the devs had the same idea but abandoned it.
Re: Sky outside / normal lighting inside?
So I tried disabling sky components when the player is inside, then re-enabling them if they are looking out of a 'window'. It doesn't really work convincingly, so I abandoned it.
Instead, I've enabled the unused castle window model from the asset pack, and set up some lights for it. It's not great, but I think it's OK for now. Clearly I would need to change the internal white texture of the model (so that it could be replaced with a sky material/shader), but for now I'm just seeing what I can achieve without needing to modify any models:

Instead, I've enabled the unused castle window model from the asset pack, and set up some lights for it. It's not great, but I think it's OK for now. Clearly I would need to change the internal white texture of the model (so that it could be replaced with a sky material/shader), but for now I'm just seeing what I can achieve without needing to modify any models:

- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: Sky outside / normal lighting inside?
I think Germanny did something similar. In his tileset there is an object called dm_ceiling_breakin. When placed it shines a light down similar to your window experiment and those who look up can see sky above. Looking into that object and how it's done might help.
Re: Sky outside / normal lighting inside?
That's easy: there is just a flat "screen" over the hole with a nightsky texture on it.
Re: Sky outside / normal lighting inside?
It wouldn't, the object has absolutely nothing to do with sky, it's the same as the Grimrock 1 version but with a spot light added.Dr.Disaster wrote:I think Germanny did something similar. In his tileset there is an object called dm_ceiling_breakin. When placed it shines a light down similar to your window experiment and those who look up can see sky above. Looking into that object and how it's done might help.
In general, SkyComponent has 5 important effects on the environment:
1. The skybox itself, obviously
2. The ambient light. This is the LightComponent called "ambient" and it illuminates every triangle on the level equally, with no particular origin or shadow casting.
3. The regular light. This is the other LightComponent and rotates around the skybox during the day, but stays stationary during night. This one does cast shadows. Think of it as a regular area light with infinite range that is infinitely far away.
4. The lens flare. When you look at the aforementioned light during the day, there's a lens flare effect that makes it look like you're looking at the sun.
5. The tonemap saturation. This field multiplies the red/green/blue saturation (but NOT brightness) of everything on the level by the specified values. It's used by the cemetery sky in the standard assets to make everything grey, but it can also be used to increase the saturation by using values above 1.0, or even invert the colours with values below 0.0.
The reason your indoor environments look goofy with SkyComponent on the level is 2, the ambient light: it's illuminating the inside of your buildings, because it lights every triangle equally. You could simply disable the component to get rid of the ambient light, but that will make the outdoor part of the level look odd, of course. The easiest solution that would still look ok is probably to fade the ambient component in and out as you enter/exit the indoor areas. IIRC both LightComponent:setBrightness() and SkyComponent:setAmbientIntensity() will work for this. Windows should look fine with the ambient light disabled/at zero brightness, since the area light, lens flare, and skybox are still there.
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: Sky outside / normal lighting inside?
Thanks for the input minmay, very helpful. I've realised however that I've not described my intentions clearly enough. There isn't actually an outside area on the map. The whole map is an interior dungeon. What I wanted to do was create windows that open onto say a single empty cell, and then apply a skybox effect to that cell, so that it would seem to be a complete sky that the player is looking at through a window.
Clearly Grimrock skies don't work the way I'd like. Never mind, the window solution noted above is fine, and when I've learned some basic Blender, I'll be able to fake a sky texture on that. It'll be good enough.
Clearly Grimrock skies don't work the way I'd like. Never mind, the window solution noted above is fine, and when I've learned some basic Blender, I'll be able to fake a sky texture on that. It'll be good enough.
Re: Sky outside / normal lighting inside?
I don't think you need Blender to do that... You can simply override the material on the sky mesh with materialOverride property.gambit37 wrote:Clearly Grimrock skies don't work the way I'd like. Never mind, the window solution noted above is fine, and when I've learned some basic Blender, I'll be able to fake a sky texture on that. It'll be good enough.