infinitive far clipplane?
Blitz3D Forums/Blitz3D Programming/infinitive far clipplane?
| ||
hello! for our shadow system, i need to know how to make an infinitive far clipplane. i don't mean 1.000.000 or so, really infinitive... thanks for help anyway :) |
| ||
Just skip the mathematical clip test on the plane you want to be infinite. but: Its normally not desired to have something like this due to calculation and depth buffer errors in masses if you don't clip at a usefull distance. already 100'000 would be by far too large (especially for the depth buffer) But I'm not sure if you should add something like "infinite" as the shadow drops most likely will be bugged long before that and cost massive FPS. Thats one of the reasons, 3d games with high end 3d engines don't have light sources that cast shadows on a flat angle. (HL2 shows that quite good, all sources nearly overhead and even then the shadow drop max range is extremely restricted. it does not even cast from 2nd floor to first floor and the like) |
| ||
This works (tested with my own shadow system), but I don't know if it's wise to use it as I don't think any geometry will get clipped by the far clip plane at all. You might want to also have a GetTransform() to record the Projection Matrix so you can reset it later. Function GetProjectionMatrix(m.mat) GetTransform 3,m End Function Have a mess about with it, see what happens :) ;D3DMATRIX Type mat Field m1#,m2#,m3#,m4# Field m5#,m6#,m7#,m8# Field m9#,m10#,m11#,m12# Field m13#,m14#,m15#,m16# End Type Function InfiniteFarClipPlane() Local m.mat = New mat GetTransform(3,m) ;infinite far clip plane e#=0.00000001 m\m11 = 1.0 - e m\m15 = .1*(e - 1.0) ;.1 = camera near SetTransform 3,m End Function p.s I dunno if I left Get/Set Transform in the DX7 DLL you have now, if not lemme know and I'll put up a new .decls Tom |
| ||
thx tom, this works perfect :) |
| ||
I would like to give it a go ... but on the dx7tes.decls and dll I have there is no set/get ransform functions. Where can I find the appropriate decls and dll? Thanks |
| ||
you can download the latest dll with my shadow system. the pic in my signature. |
| ||
Hello Devils child, I tried it (tom's code above)but I see no change in the far clipping plane, apart from setsystemproperties, is there any other neccessary initialistaion/tricks? EDIT Sorry found it, the function needs to be called each loop. |
| ||
you have to initialize this dx7 dll. i dont know whether you have the latest dx7 dll. the latest one is included to my shadow system. download it on www.devil-engines.net and see how it works. |
| ||
Hello, I have been using this technique to manipulate the projection matrix ... setTransfrom(3,m) ... the number 3 targeting the projection matrix in fact. Now whenever I use Blits' camerazoom, cameraprojmode or change cameraviewport, it seems I cannot have setTransform doing anything. Anybody has a workaround? Or does anybody knows which matrix the Blitz' commands are accessing? (seems it's not the DX projection matrix). |