Hello everyone, I'm a italian developer of a horror mod called The Whisper, some of you might have seen me in the Arrangement community. I found your forum long time ago and I learned from your tutorials and useful advices. Now I want to ask something that bothers me a lot. I am in need of help with shadows.
From what I learned, there are 2 type of shadow. Stencil Shadows and Shadowmaps. Those 2 techniques are different, the first creates Hard shadows while the second creates the nice looking Soft shadows.
I tried many of them, the Stencil Shadows from Raven City, but I couldnt implement them into my mod because I was using Paranoia's renderer. Then I used Buzzer's Stencil Shadows from Paranoia 1.3, and I'm stuck with them for now.
I recently played HLFX 0.5b, and I saw the shadow maps demo. That was fantastic, the most realistic shadows I ever saw for HL and I thought that would be very useful into my mod.
Now I have a questoin. Is that kind of shadow from HLFX 0.5 open-source? And if it isnt and the author wont share it with me, can anyone tell me at least how it is done, what should I learn to create those awesome shadows?
HLFX never was an open source project.
As for shadow maps, they were the simplest ones. You just needed to create a shadow entity (env_shadowlight), assign a field of view, then on client you render the world into depth texture from light's position (this is easy especially if you are familiar with Paranoia's renderer that is custom). After you got a depth texture, you may use it to render a shadowed part of world, using a special depth texture comparison (google for ARB_shadow OpenGL extension). And of course you may use fragment program to antialias shadows and make them smoother.
There is a lot of demos in the Internet.
Your mod's screenshots look very nice. Are you sure you want to use these buggy shadows along with legacy engine?
XaeroX писал: HLFX never was an open source project.
As for shadow maps, they were the simplest ones. You just needed to create a shadow entity (env_shadowlight), assign a field of view, then on client you render the world into depth texture from light's position (this is easy especially if you are familiar with Paranoia's renderer that is custom). After you got a depth texture, you may use it to render a shadowed part of world, using a special depth texture comparison (google for ARB_shadow OpenGL extension). And of course you may use fragment program to antialias shadows and make them smoother.
There is a lot of demos in the Internet.
Your mod's screenshots look very nice. Are you sure you want to use these buggy shadows along with legacy engine?
Oh, I'm sorry I didnt know that it wasnt open-source.
Thank you for your info, I really hope to get them into the game, I'll need to start from the very beginning but with some effort, maybe I can make it.
Цитата:
XaeroX писал:
Your mod's screenshots look very nice. Are you sure you want to use these buggy shadows along with legacy engine?
Oh thanks! Well I hope I can stay with Paranoia's renderer, my problem is that Buzer's shadows have fixed direction, they're not affected by light sources. And dont even cast on models. Thats why I wanted to use your shadows, they look nice and the whole world is affected by them not only models.
BUT! If you have a better solution \ suggestion I'm open to listen carefully to your words, since I dont know basically anything about graphics programming.
Your mod is just awesome, i mean you kill every single HL1 mod with level design skills and graphics effects. After i've seen your modification (two weeks ago) i actually lost my motivation to do my horror mod which is unofficial continuation of They Hunger
Well you should think about rendering framebuffer object from light point of view, then create sth like fragment program which will actually send depth of the current fragment to the frame buffer and apply two or three passes so we can have them softy. In the fragment program read the shadow map, if current fragment have depth lower than set value do not drop shadow on the surface, if not compute the variance from lightmap and it's opposite and scale light intensity .
HLFX shadows are buggy sometimes, i mean if monster is near wall the shadow is beign rendered behind wall too, that's what i noticed few times.
If someone will get it with shadow maps then it will be pure awesomness of awesomness * awesomness / awesomness sqrt(awesomness) * 666.
Well i know that this technique has been used in HLFX already but HLFX is closed source and if someone will get this thing to work maybe he will share teh codez ?
Cheers.
__________________
настоящий мужчина не нуждается в подписи.
supra36 писал: HLFX shadows are buggy sometimes, i mean if monster is near wall the shadow is beign rendered behind wall too, that's what i noticed few times.
It refers to HLFX 0.6 shadows, not 0.5 ones, doesn't it?
supra36 писал: Your mod is just awesome, i mean you kill every single HL1 mod with level design skills and graphics effects. After i've seen your modification (two weeks ago) i actually lost my motivation to do my horror mod which is unofficial continuation of They Hunger
Well this is something I really dont want. Dont lose your motivation. I'm mapping for Goldsource since 1998 when I was like 11, so its natural that I've improved over the years. Practice makes perfect just believe in what you're doing.
Цитата:
supra36 писал:
[B]
If someone will get it with shadow maps then it will be pure awesomness of awesomness * awesomness / awesomness sqrt(awesomness) * 666.
Well i know that this technique has been used in HLFX already but HLFX is closed source and if someone will get this thing to work maybe he will share teh codez ?
Cheers.
If I succeed I'm willing to share the code with the whole community, but keeping it my mod's exclusive for some time after its release, lets say 3-6 months.
I'd also like to work on this with someone else more expert than me that can actually teach me some parts that I dont understand.
Цитата:
XaeroX писал: You just needed to create a shadow entity (env_shadowlight), assign a field of view
then on client you render the world into depth texture from light's position (this is easy especially if you are familiar with Paranoia's renderer that is custom).
Ok let me know if I got this correctly.
The env_shadowlight must have a field of view. Is it the same field of view a monster has? And about the world rendered from lights position, you suggest I should look into Paranoia's renderer. I'm thinking about cubemaps that are rendered where there's a light source. Is that a correct starting point?
RavenPest писал: I'm thinking about cubemaps that are rendered where there's a light source. Is that a correct starting point?
Almost. Cubemaps cover all possible directions, but you are limited with 2D texture using shadowmaps (uh, in its normal implementation; you may use shadowcubemaps with shaders, but I never did) therefore you declare a field of "view" of the lightsource - and of course a direction of view.