I tried looking up what I'm about to write here, but I didn't find it anywhere and so I assumed I am the first to think of this.
Ever thought "Man, I wish JKA had higher resolution shadows" when you create a map?
Lightmaps always leave a blocky shadow, especially if you make them thin. But how do you achieve very thin lines?
Better said, how do we create shadows, as if a bordered window casts them?
This is where I came from:
And this is what we will create:
It's actually pretty easy to get such shadows, if you get the know how, what I'm about to give you!
You probably know about decals. Polygons that stick to a surface as a sticker.
We are going to create a fake lightmap in Photoshop, based on a texture that we want to simulate light from as shown in the picture below:
The Texture
Now onto shadering
Save your file as a JPG (NOT PNG as it will leave some fractals) The shader itself can just be copied from the original JKA Decal shaders. They are actually all similar.
Optionally you can animate the shader with multiple jpegs, for when there's a storm outside for example. But we will keep things simple.
My shader:
textures/*yourmap*/*yourshadowtexture* { surfaceparm trans polygonOffset q3map_nolightmap q3map_novertexshadows surfaceparm nomarks //this will stop the game from rendering shadows and burnmarks on the decal// nopicmip { map textures/*yourmap*/*yourshadowtexture* blendFunc GL_DST_COLOR GL_ZERO alphaGen const 0.7 //This is an optional line of code, that will make the texture more opague// } }
GTK Radiant
To place the shadow in game, open up the systems shaders, create a "nodraw" brush on the place where you want the shadows to cast.
Make it so one of the sides of the brush z-buffers with the brush you want the shadow on. Now select the top polygon (Ctrl + Shift + Left Mouse) and apply the texture.
Open up the Surface Inspector, and click "Fit". If it doesn't fit the way you want, rescale the brush, and select "Fit" again.
Continue fitting, and once you are happy, compile you map!
Don't forget to set sv_pure to 0 if you are working without compiling to Pk3!
Start the game, open up your map and...
You will have a high resolution shadow!
Continue tweaking the Lights so it gives a realistic effect, and you are happy about the result!
One downside on this: low end computer who are forced to use Global Lighting, will see the shadows as decal and not as actual shadow.
But think about it, we live in 2014. There aren't many computers who need to have global lighting enabled all the time
Protip: The same technique can also be used on static models like small trees, X-wings etc. Just as long as you can get a screenshot from the right angle.
Then you can just use the picture above as reference, and give the shadow a small Gaussian blur instead of a tilt shift blur.
I hope this small tutorial helped you create awesome content!
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now