Springheel 4645 Posted March 12, 2008 Report Share Posted March 12, 2008 I had two ideas for making some window textures with a little life in them. Imagine walking through Jdude's city, and seeing a light suddenly go on in a window above your head, or seeing the shadows of people moving through the tavern window across the street. I'm pretty sure both are doable with texture shaders, but I'm not totally sure how to set them up properly. 1. Make a window texture that fades from fully lit to unlit and then back again. I know this could be done easily with a gui, but could probably also be done with a texture shader by someone who knows what they're doing (Gildoran?). For best effect, the pattern of fading would have to be randomized, however, and I'm not sure how to do that. Is this possible, and if so how would it be done? 2. Use a gui or roq file to create the murky shape of moving figures behind a lit window. I could do this with a regular scrolling texture, but really it needs to be randomized for best results. Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps Link to post Share on other sites
SneaksieDave 40 Posted March 12, 2008 Report Share Posted March 12, 2008 I like that tavern shadows idea. That would likely be the animating shader, I'd guess. Would have to keep the player out of areas like that of course, unless it was scripted to turn off when they're inside. Hm, then again, I assume it could be done in a more straight-forward way: maybe have one of those spectrum3 windows Gildoran demonstrated, and just have AI walking back and forth such that their shadow is cast on it. Doesn't give the illusion of bodies behind an opaque screen though... for that the shader would be better. For the other, the light going on or off, I would probably just have a timed light which turns on and off (and maybe switching skins if necessary) controlled by a trigger_timer. Quote Link to post Share on other sites
New Horizon 524 Posted March 12, 2008 Report Share Posted March 12, 2008 If it's just for a window, you wouldn't need to use a real light...just an animated texture would be fine. This would add some realism to the windows if the light flickered and swayed in some of them...like a candle in a drafty room. Quote Link to post Share on other sites
SneaksieDave 40 Posted March 12, 2008 Report Share Posted March 12, 2008 That's also true in some cases, and would be best for performance. I was mostly thinking the gameplay-affecting case where the light being on casts a beam on the ground, blocking (or opening) your way. Quote Link to post Share on other sites
Springheel 4645 Posted March 12, 2008 Author Report Share Posted March 12, 2008 Would have to keep the player out of areas like that of course, unless it was scripted to turn off when they're inside. You'd only do it on the outside, presumably. But you'd want to avoid situations where you could see into the room and see the outside of the window at the same time. Hm, then again, I assume it could be done in a more straight-forward way: maybe have one of those spectrum3 windows Gildoran demonstrated, and just have AI walking back and forth such that their shadow is cast on it. I want to avoid the mapper having to actually put AI behind a window--that's way too heavy on performance. I know a scrolling texture would work, it's just the randomizing part I'm not clear on. I'm pretty sure Gildoran said you could randomize animated textures, but I don't recall how. Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps Link to post Share on other sites
Gildoran 0 Posted March 13, 2008 Report Share Posted March 13, 2008 You could certainly do things with the window brightness fading in/out over time and with having "shadows" move across the brightness. You'd probably just use tables to control the animation. However tables loop over time and aren't random. You can't have truly random materials without some outside source influencing their parameters (which would require the window to be on an entity). If you have a bunch of windows just applied to worldspawn, they will all animate the same way, all in-sync. There may be ways to mitigate that by having different animations for different parts of the texture space, but it could be difficult for the texture artist to set up, and would require the mapper to have each window occupy a different part of the texture space. It might also require more render passes per window, leading to performance problems. If you want to have randomly animated windows which behave independently, by far the easiest way would be to put each window on a separate entity designed to control the window, though that could quickly eat up the 4096 entity limit. (it may be possible to economize by having a single entity control up to 12 independent windows) The other challenge would be having the window controller only running when in PVS; I think my previous solution to this may be buggy on multi-core systems, but using a more conservative approach should work almost as well. I'm pretty sure Gildoran said you could randomize animated textures, but I don't recall how. It's not possible for a texture to be truly random by itself. I might have been referring to using textures to cause stars to pseudo-randomly twinkle, or to using entities to randomly control textures... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.