News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Need help with smoothing.

Started by abi008, February 04, 2015, 02:12:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

abi008

I have sikkmod installed and I can see that smoothing on monsters are fine, but when I place any other custom model, there are no shadows on mosters at all.  Then I removed 2 lines:

   noShadows      // sikk - Added - Self-Shadow Fix
//   noSelfShadow      // sikk - Removed - Self-Shadow Enabled

in pak_modfiles.pk4 > materials > monsters.mrt and finnaly got  self shadows on monsters, BUT without smoothing (shadows on model are popping up). I am really confused and don't know how to get custom models with smoothing in Sikkmod.

argoon

#1
Self shadows on doom 3 never looked good, they always showed the object low poly shadow mesh, but can you show us a screen to see if this is the case also if you want to know about model smoothing on the idtech 4 engine this link can help.

http://www.katsbits.com/tutorials/idtech/what-are-smooth-groups-and-mesh-smoothing-on-models.php

abi008

Here is the video:
https://www.youtube.com/watch?v=btOvaXCPhb0
It's little hard for me to explain bcs I don't have any basic knowledge about 3D.

nbohr1more

The only solution is to create a new model with increased polygon count.
Vertex smoothing doesn't work with Doom 3's shadow method, it's purely polygonal.

The current optimal solution:

noSelfShadows // disable self shadows
// noShadows  (don't disable shadows cast from the monster onto surfaces)

in lieu of disabling cast shadows for performance reasons, you could also do what we do
at The Dark Mod and make a low-poly "shadow mesh".

aphexjh

#4
IIRC Sikk has both a Lo-poly shadow mesh and the hi-poly smoothed mesh, which are rigged and driven by the same rig as the original imp. In other words, he has 2 models in 1. Its possible that you might need to export a .md5mesh with both your new model and another low-poly mesh for the shadows, all rigged to the imp skeleton, and then implement 2 materials, the shadow and smoothed visible material in the way Sikk has done. This will also require changing the model in the .def file, which it sounds like you are doing.
Depending on your level of familiarity, it might make sense to see how the stock d3 models are skinned, since they traditionally use only one mesh. However, for performance reasons, using a hi-poly model with shadows has drawbacks, which is what led Sikk to devise this dichotomous approach. Hope this helps.

argoon

Sikk didn't made the ability to use low poly shadow meshes that was already on the original engine as far as i know, you just use the shadow material on a object and it will be invisible but cast shadows.

aphexjh

right, well I just mean that they don't use invisible shadow meshes in vanilla d3, that is something that Sikk did.  In Doom 3, they just turned off self-shadowing in the monsters' materials and had done with it.

oneofthe8devilz

#7
I wanted to post about this "stencil self shadow poly popping" issue quite some time ago, so I am glad someone else already opened the topic...

As far as I am aware there are multiple approaches to fix that issue...

1. Would be to rewrite the renderer to use shadowbuffers/shadowmapping instead of stencil shadows.

2. Would be to apply a (hacky) stencil shadow blur filter (like Sikkpin did at gigantic performance costs)

3. Would be an asset modification solution, where the model in question is copied and very slightly down-scaled. Then an "invisible" shadow casting material is applied to that re-scaled copy and shadow casting for the original mesh is completely disabled. This method works very good but comes at the price of doubling the polygon count for all your "SelfShadow Casting" models and assets.

4. The forth (and my personal favorite) method is to do step 3. within the engine renderer. I have seen games that do it like "Thief: Deadly Shadows" for example where the stencil shadows for each model/asset are calculated and then that "stencil shadow object" is slightly re-scaled before being drawn over the scene... It looks great eliminating ANY shadow popping and it should not come at the extreme double polygon extra cost...

When I get to it I will post some showcase images from idtech4 and Thief: Deadly Shadows for a better visualization of the problem and the solutions.
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

BloodRayne

#8
I've always felt that a post render effect could be applied that smooths shadows (generally, both self shadowing and the world), but I never saw any that worked well. The theory would be to 'scan' the outlines of the shadows and apply post-render blur to them, keeping z-order in mind (which means plugging the post-fx into the renderer by exposing the z-buffer to it, much like 3dsMax post fx work).

But I'm not a graphics programmer so I was completely stumped on how to program that.

oneofthe8devilz

It seems to me that the following thread describes multiple "stencil self shadowing poly popping fixes": https://www.opengl.org/discussion_boards/showthread.php/147877-Stencil-shadows-and-smooth-shading

What I wonder is why Carmack himself did not implement such a method but instead simply disabled self shadowing for most Doom3 Characters ???
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

Perhaps JC considered it and maybe even tested it, but for 2004 (or maybe even earlier) it was too slow? Or maybe they didn't feel it was necessary for the game's atmosphere.

Shadow volumes is a dead end in shadowing anyway.

oneofthe8devilz

#11
Quote from: motorsep on February 21, 2015, 11:56:37 AM
Perhaps JC considered it and maybe even tested it, but for 2004 (or maybe even earlier) it was too slow? Or maybe they didn't feel it was necessary for the game's atmosphere.

Shadow volumes is a dead end in shadowing anyway.

I think that really depends on the scenario...

When it comes to "high radius shadow casting pointlights", none of the AAA industry engines have managed to convince me... I have experimented with Cryengine, UnrealEngine, Unity, etc and all their shadowmapping algorithms perform terrible with "omni directional point lights"... I always manage to produce situations where shadowmap-resolution-issues, light-bleeding, shadow-acne, etc produce unacceptable results... probably that is the reason why for the most part, realtime lighting in these engines and the resulting games, use either parallel or projected lights instead of pointlights...

ShadowMapping cannot compete in that regard with the pixel and sub-pixel accuracy of stencil shadows in that specific scenario...

But who knows, in the end maybe both approaches will be abandoned in favor of raytracing or voxel based shadow rendering techniques, once we have the parallel gpu/cpu processing power...
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

Well, there is no need in having large radius point lights. Your scenario is "let me find what can't be done, even it's never used in practice" :/ With real-time GI and direct lighting you don't need large radius lights. There is no scenario for indoors that requires massive point lights. RBDoom 3 and our engine have really decent shadow mapping with point lights.

I don't see how going with models from 2004 (really low poly) and shadow volumes would make game visually appealing. With all shadow mapping flaws, modern games look a way better than Doom 3. And Doom 3 with shadow maps looks a way better than original Doom 3 (and it doesn't use large radius point lights anyway).

oneofthe8devilz

Alright, since you obviously are not reading what I am writing let's make some practical comparison shots...

The "upper shot" is stencil shadows and the "lower shot" is shadowmapping (rbd3bfg)...

I created these shots in just 20 secs switching back and forth between stencil shadows and shadow mapping in my little testmap which is by no means a super exotic exceptional case scenario... In Doom3 in general and in my idtech4 projects in particular more than 90% of all the map lighting is done by pointlights...

As you see in the following shots, shadowmapping fails to properly render the character's hood shadowing compared to the stencil shadow path (hood <-> face contact area)... And this is not some crazy super radius pointlight.. It is a pointlight that is less than 2 "real-world" meters away from the character...

So effectively I get faulty "contact" shadows with shadowmapping at a performance cost of up to 400% compared to stencil shadows...

And this is just one of countless issues/scenarios I spotted with shadowmapping while testing it with my projects and it is a general issue with all modern game engines due to the nature of how shadowmapping works. In my case for my projects in those kind of scenes, shadowmapping produces un-usable results...

...I don't want to even begin talking about all the issues I encounter at outdoor scenes and other areas...

So like I wrote earlier... it really depends on what you are working on... At this current state and performance cost that shadowmapping approach is simply not feasible for my projects and I don't see anyone actively working on improving the problems (please correct me if I am wrong) ...

(click the image to load the highres version)


(click the image to load the highres version)


(click the image to load the highres version)


 
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

#14
Did it occur to you that maybe your assets aren't made for shadow mapping? Or maybe that shadow mapping can be tweaked (which is what some AAA games do, based on specific scenario)? Or maybe RBDoom 3 has screwed shadow mapping implementation? (which is a fact since we had to rework shadow mapping a bit for Storm Engine 2)


I am certain you play modern video games, so you have probably seen hooded characters with proper shadows.

Performance cost is, yet again, because of how RBDoom 3 implemented shadow mapping. We don't have this issue in Storm Engine 2.

EDIT: Did some tests here and I get the same issue. Now I remember that shadow mapping doesn't "like" thin geometry. I made hoodie quite thick (which isn't suitable for anything but tests) and it began casting shadow on the face.

This is a choice you have to make as a game developer. Do you want to stay in 2004 and make Doom 3 like looking game (I suppose hood casting shadow on the face is very critical part of your game and makes day and night difference for gamers); or do you want to move on and allow higher polycount budget without sacrificing performance (plus you can get smoke casting shadows!), but at a cost some minor artifacts/acne and hoods not casting shadows on characters' faces. Apparently 99.9% developers opt out for shadow mapping.

Note that shadow mapping is done purely on GPU, freeing CPU to do model collisions, physics, and AI. Shadow volumes are CPU bound, which limits what can be done with AI, physics, etc.