Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: 1 2 3 [4] 5 6
  Print  
Author Topic: [Source, Library, Sample] Parallel Split Shadow Mapping that you can re-USE  (Read 30733 times)
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #60 on: June 11, 2009, 08:41:37 AM »

Colorful shadow maps are indeed a bit rate, but it's a "feature" of my PSSM implementation. Since I split the cameras view frustum into four parts I also have four depth maps (=shadow maps). Instead of using four textures per depth map, I write the depth information of frustum part one into the red channel, part two into the green channel and so on. Having a colored shadow map doesn't mean that the shadows will be colored too. If you wanna find out if a certain pixel is shadowed, you keep on using one of the shadow test, e.g. the classic one:  shadowed = my depth projected to light space < light space depth.

Hope this helps
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
sgrippa
Customers
Community Member
*****
Posts: 238


« Reply #61 on: June 15, 2009, 04:35:29 PM »

I've downloaded your PSSM implementation and tried to port it in Vb.net but everytime I try to instantiate your class it keeps me throwing a null reference exception.

It's strange since I've instantiated many other classes (newing them) and after two full days I keep knocking my head on the wall.

Maybe do  you have a Vb.net sample to share or a general guideline to show ?

Another thing, if I understand correctly your PSSM doesn't care at all about casters and receivers so in theory it may be possible to project shadows on landscape. Is this correct ?

Thanks in advance.
Logged

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #62 on: June 15, 2009, 11:13:38 PM »

I've downloaded your PSSM implementation and tried to port it in Vb.net but everytime I try to instantiate your class it keeps me throwing a null reference exception.
Then you have done something wrong Smiley Where does the exception come by?

Another thing, if I understand correctly your PSSM doesn't care at all about casters and receivers so in theory it may be possible to project shadows on landscape. Is this correct ?
Indeed. PSSM is meant for large-scale environment.
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
sgrippa
Customers
Community Member
*****
Posts: 238


« Reply #63 on: June 16, 2009, 05:48:11 AM »

Then you have done something wrong Smiley Where does the exception come by?
Indeed. PSSM is meant for large-scale environment.


Yep, I'm surely doing something wrong but I can't find the error,

Actually I reference the variable this way

Quote
    Private m_pMeshShader As TVShader
    Public drawdepth As TVRenderSurface
    Public lightPos As New TV_3DVECTOR(-10, 150, 10)
    Public myParallelSplitShadowMapping As eStudioz.PSSM.CParallelSplitShadowMapping

then, after the form focus
Quote
myParallelSplitShadowMapping = New eStudioz.PSSM.CParallelSplitShadowMapping(1024, CONST_TV_RENDERSURFACEFORMAT.TV_TEXTUREFORMAT_HDR_FLOAT32, 0.0125F, New TV_3DVECTOR(0.5F, -0.5F, 0.5F))

then the compiler throws a null reference exception on the creation of the new instance...
Logged

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #64 on: June 16, 2009, 01:46:55 PM »

then you might apply your tv3d interface instances to the eStudioz.PSSM.TrueVision3D.XXX ones Smiley
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
sgrippa
Customers
Community Member
*****
Posts: 238


« Reply #65 on: June 17, 2009, 03:59:14 PM »

Using the truevision3d instances it seems to work. Anyway the exception is gone.
At the moment I'm busy at work but I will try tomorrow to finish and tst it on a landscape with some meshes.

Thanks for the help Mietze. Smiley
Logged

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #66 on: June 17, 2009, 11:18:44 PM »

np Smiley
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Gamecode
Customers
Community Member
*****
Posts: 467


WWW
« Reply #67 on: August 04, 2009, 01:09:56 PM »

any source fot vb.net ?
Logged

aiR Captains - RC aircraft project TV65
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #68 on: August 04, 2009, 01:52:12 PM »

For that reason it's a DLL. You can simply include it into your project and use it. It's as simple as that.
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Gamecode
Customers
Community Member
*****
Posts: 467


WWW
« Reply #69 on: August 04, 2009, 03:00:18 PM »

For that reason it's a DLL. You can simply include it into your project and use it. It's as simple as that.

simple ?Smiley i am a looser :-D

if somebody have vb.net code,or functionaly .net C code (i download from first page,and cannot run it) please post it :-D
Logged

aiR Captains - RC aircraft project TV65
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #70 on: August 04, 2009, 04:06:26 PM »

It is actually working code, but if you read carefully, you will see that you need to copy the MTV3D65.dll into the binaries folder.
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Raul
Customers
Community Member
*****
Posts: 550

I like games.


WWW
« Reply #71 on: August 10, 2009, 06:32:19 PM »

Mietze I have same problem as sgrippa:

My Code:
Code:
        eStudioz.PSSM.TrueVision3D.InputEngine = mGlobals.Inp
        eStudioz.PSSM.TrueVision3D.MathLibrary = mGlobals.Maths
        eStudioz.PSSM.TrueVision3D.Scene = TrueVision3D.Scene
        eStudioz.PSSM.TrueVision3D.InputEngine = mGlobals.Inp
        eStudioz.PSSM.TrueVision3D.Screen2DImmediate = mGlobals.Screen2D
        eStudioz.PSSM.TrueVision3D.Screen2DText = mGlobals.Text2D
        eStudioz.PSSM.TrueVision3D.TextureFactory = mGlobals.Tex
        eStudioz.PSSM.TrueVision3D.LightEngine = mGlobals.LightEngine
        eStudioz.PSSM.TrueVision3D.Engine = mGlobals.TV
        eStudioz.PSSM.TrueVision3D.MaterialFactory = mGlobals.Mat
        eStudioz.PSSM.TrueVision3D.Globals = mGlobals.Globals
        eStudioz.PSSM.TrueVision3D.Atmosphere = mGlobals.Atmos
        eStudioz.PSSM.TrueVision3D.GraphicEffect = mGlobals.GraphicFX
        eStudioz.PSSM.TrueVision3D.CameraFactory = mGlobals.CameraFactory
        eStudioz.PSSM.TrueVision3D.Physics = mGlobals.Physics

        'SHADERUL de shadow
        m_pMeshShader = Scene.CreateShader()
        m_pMeshShader.CreateFromEffectFile("shaders\pssm_mesh.fx")

        ParallelSplitShadowMapping = New CParallelSplitShadowMapping(1024, CONST_TV_RENDERSURFACEFORMAT.TV_TEXTUREFORMAT_HDR_FLOAT16, 0.0125F, New TV_3DVECTOR(0.5F, -0.5F, 0.5F))

and here the compiler throws a null reference exception on the creation of the new instance Sad

EDIT:
DAMN !!

I forgot a Truevision string up there...
« Last Edit: August 10, 2009, 06:35:46 PM by Raul » Logged

Raul
Customers
Community Member
*****
Posts: 550

I like games.


WWW
« Reply #72 on: August 10, 2009, 06:54:16 PM »

Well. Everything is set up, but my objects are simply disappearing. When I enable the shader they just vanished. :-?

 Same issue running your test Sad

http://img25.imageshack.us/i/24812512.jpg/
« Last Edit: August 11, 2009, 12:08:42 PM by Raul » Logged

Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #73 on: August 11, 2009, 12:57:14 PM »

Then your grapics card can't handle the specified shader model, probably. Check the truevision log files for some compiler errors of the .fx effect files. Maybe there's something interesting in there Smiley
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Raul
Customers
Community Member
*****
Posts: 550

I like games.


WWW
« Reply #74 on: August 11, 2009, 01:04:49 PM »

hehe. my graphic card works fine its me just STUPID. i ran your code from IDE and no shader is loading. (stupid)  (stupid)  (stupid) (stupid)

now your sample works fine, but i still have some problems porting it to VB:

http://img9.imageshack.us/i/93893095.jpg/
Logged

tedlin01
Customers
Community Member
*****
Posts: 140


WWW
« Reply #75 on: September 03, 2009, 09:30:45 AM »

I have some questions.
1. If I understood correct I can't use internal TV3D shader with custom shaders. So if I want to use this shader I must expand the shader with functionality for lightning also?

2. What do I need to do to get a texture on the meshes that runs with this shader.
« Last Edit: September 03, 2009, 10:00:32 AM by tedlin01 » Logged

Toaster
Community Member
*
Posts: 378


WWW
« Reply #76 on: September 03, 2009, 10:22:41 AM »

You cant use the internal TV shaders unless you use some sort of screen space method. IE rendering the shadows to a render surface and then using a full screen combine shader to combine the TV's Color with the Shadows.

You will have to edit the pixel shader to add a texture. Adding a simple texture to the shader isnt very hard though. It would be something like this:

Code:
Color = tex2D(TextureSampler, IN.UV);
OUT.Color = Color * Shadow;

That's very basic and ofc you'll need to learn what a texture sampler is and how to use them as well as the UV's. I suggest learning HLSL and its not as hard as everyone makes it out to be.

-Toaster
Logged

Visit my site at: Unknown Abstraction
Mietze
Community Member
*
Posts: 415

Pleeease, don't let it crash!


WWW
« Reply #77 on: September 03, 2009, 02:28:02 PM »

Totally agreed with Toasters white bread!
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
tedlin01
Customers
Community Member
*****
Posts: 140


WWW
« Reply #78 on: September 07, 2009, 11:02:31 AM »

I have ran into a problem.

This picture explains it all.
Green = good shadow
Red = bad shadow that is moving around on my meshes when I move the camera. The floor works great though. Shadows is standing still on the floor.

http://img141.imageshack.us/i/shadowerror.png/

What to do? Shocked
Logged

tedlin01
Customers
Community Member
*****
Posts: 140


WWW
« Reply #79 on: September 07, 2009, 11:08:01 PM »

okey, I'm starting to get this now Smiley
One question though. Is it possible to remove the frustumculling on the shadowmap?
I have tried but I'm not good enought to figure it out.

The reason is that I want to render the map once then use it without updating it.
« Last Edit: September 07, 2009, 11:11:46 PM by tedlin01 » Logged

Pages: 1 2 3 [4] 5 6
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks