Jump to content

Jedi Academy turned 20 this year! We celebrated in a ton of different ways: mod contest, server event, podcast, etc. Thank you to all who have been a part of this game for the last two decades. Check out the anniversary content!

Read more

Welcome to JKHub

This community is dedicated to the games Star Wars: Jedi Outcast (2002) and Jedi Academy (2003). We host over 3,000 mods created by passionate fans around the world, and thousands of threads of people showcasing their works in progress and asking for assistance. From mods to art to troubleshooting help, we probably have it. If we don't, request or contribute!

Get started

This game turned 20 years old this year, and it is still one of the greatest Star Wars games of all time. If you're new or returning from a long hiatus, here are the basics of getting started with Star Wars Jedi Knight Jedi Academy in 2023.

Read more

High resolution shadow trick


Vulcan

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. :P

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:

 

CcAq4Fy.jpg


And this is what we will create:

 

vXB5LI0.jpg



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
YWAdqzO.jpg


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! :D


User Feedback

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...