You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

The contents of this page handle general informations about model shadows, how to implement a model with shadows as a custom .mdl into your module - and solutions for issues that might (and probably will) come along the way. If you happen to encounter a problem that can't be solved with any of the solutions below, you can always ask around in the community and the discord. Note that the given solutions might not apply to your specific problem. If the bug perists, or if you find a way around it, by all means, do share it with us to keep the flame alive.

It goes with saying that you have a backup of your file before you head out to edit or export it, therefore the author of this page takes no responsibility if data gets lost along the way.

Shadows

Definition

What are shadows essentially? This question might be irritating to some and feel like it's actually easy to answer.
However, as with anything, the case if often more complex as explained the quote down below:

Shadows are a result of the absence of light due to occlusion (occlusion: blocking off, blockage). When a light source's light rays do not hit an object because it gets occluded by some other object, the object is in shadow. Shadows add a great deal of realism to a lit scene and make it easier for a viewer to observe spatial relationships between objects. They give a greater sense of depth to our scene and objects. [...

Shadows are a bit tricky to implement though, specifically because in current real-time (rasterized graphics) research a perfect shadow algorithm hasn't been developed yet. Taken from LearnOpenGL, click here to learn more (Note: Neverwinter uses DirectX)

Shadow Mapping

The concept of shadow mapping is quite simple. All you need is a light source for your environment and a scene it interacts with. To demonstrate this, let's say the ground there in our image is a single tile of our area and the cube is an object in it's way - for example a crate.

The light source is constantly lighting up the space around itself where it is placed in our environment. This is described in many shapes, sometimes as a cone (car lights), sometimes a sphere (torch or light bulb) and other times it's the sun. What is important though, is that once the light hits the object in it's way, it will describe the rest of it's path as occluded, thus rendering the faces it can not physically reach as dark. While there are concepts like indirect lighting, subsurface & specular materials, for our purpose we really just need to understand the basics of Shadow Mapping as you will notice this in your toolset as well.

Since I've previously mentioned there are many shapes, the one NWN uses for it's environment is of course a sun. That means that it will cast light over the whole scene indifferent to how close the objects are to the source, instead the angle the light hits the object from is the only important measure. In our rendered example to the left, we use a point light, which is similar to a torch. That means, the further away the object is, the longer the shadow grows and the weaker the light illuminates the tile and the object itself. On the right we see the clear, constant distribution of light only obstructed by objects in it's way. In this sense, it is just a single crate. The tile itself only casts shadows from an elevated position and if a large object necessarily demands it. Notice how the weed on the ground does not cast any shadows at all, but the cliffs do. Your placeables will typically cast shadows as well.

Shadow Mapping example as seen in Blender, rendered in Eevee


Shadow Mapping example as seen in NWNToolset

Working with Shadows

Prerequisition

NeverBlender

I assume that you have somewhat basic knowledge about how to handle import-export using NeverBlender and that you can manipulate a mesh to visually express your creative ideas. If for some reason you haven't used Blender before, nor have you installed the import-export plug-in NeverBlender and have no experience with it at all, I would recommend you to to download them, read the instructions to NeverBlender from the Neverwinter Vault Page and visit some tutorials and videos on how to create your own model and import it into your module. This page does not cover NWN 2 related modelling.

NeverBlender is a plug-in that will cover your basic needs for Placeables, Doors, Models, Phenotypes, Walkmeshes, Animations and much more.

NWMax

You own 3DS Max and have the NWMax Plug-In for it? Do replace this text and add in your workflow here to enable shadows in your model export.

Step 1:

Bug: Stretching Shadows / Rip & Tear Glitch

This section handles an export bug one might encounter when exporting an .mdl model from Neverblender into the NWToolset to use as custom content.

  • No labels