|
Leon_
|
 |
« Reply #20 on: February 09, 2008, 03:04:19 PM » |
|
Hey GD,
So, today I added your scene manager in my engine. It works but I'm experiencing some problems:
If I turn on wireframe render mode objects that shouldn't be enabled because are occluded are still rendered.
Those objects exist on the MeshObject.FoundVisibleObjects list.
So how do I know that it works?
When the camera enters the bounding box of a mesh then that mesh starts to flicker on random frames, so in between I see that the meshes are actually occluded.
I'm still trying to track down if I'm doing something wrong on my part. Any ideas where to look at?
P.S. I love the way you designed the classes, it was so easy to plug it in my framework!
|
|
|
|
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #21 on: February 09, 2008, 05:26:14 PM » |
|
MeshObject.FoundVisibleObjects list is fixed. But, flickering of mesh is caused by TV bug. Well, not bug but lack of camera-inside-bbox test. So sorry sorry you need to wait for new TV DLL release. I'm glad you like the library architecture, it's inspired by master RaineC.
@Zaknafien: I thought about enums for rendering, but it dont fit the fact that FrustumCull can be called any time, and OcclusionCull only outside any render blocks.
Thanks fo your input guys
|
|
|
|
|
Logged
|
|
|
|
|
JohnB
|
 |
« Reply #22 on: February 10, 2008, 01:31:41 AM » |
|
I got the .NET DLL working with my component framework. It was a bit of a hack since I don't have the script handler up yet but it seems to work OK. Your code provides a large performance boost - I'm very impressed.
Thanks so much for sharing this!
John B.
|
|
|
|
|
Logged
|
|
|
|
|
Leon_
|
 |
« Reply #23 on: February 10, 2008, 05:10:14 AM » |
|
Hey GD, I would like your advice on how to implement the following using your scene manager.
I'm writing a LOD manager in my engine that preloads different instances of a given mesh and based on the distance from the camera uses the correct mesh.
Now I have the following difficulty:
I get from the linkedlist (MeshObject.FoundVisibleObjects) the visible scene objects but there is no way to change the mesh represantion of a given scene object after it has been created.
I though that I could create several scene objects for each model represanting the different LODs and setting the RenderEnabled property but on a second thought that's a bad idea (why cull the same model again and again).
So, basically what I'm asking is if it's possibly to have a property in order to change the TVMesh used to render the scene object.
Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #24 on: February 10, 2008, 05:59:29 AM » |
|
Thanks JohnB I'm glad you like it. Hey Leon, here's a example that should work. Remember that library is generic, you can do whatever you want extending SceneObjectWrapper class, or some predefined classes like MeshObject in this example. class MeshWithLod : MeshObject { public MeshWithLod(TVMesh mesh) : base(mesh) { }
// if you have fixed lod nums use index insead of distance // or even put in constructor like: public MeshWithLod(TVMesh mesh, TVMesh lod1, TVMesh lod2) public void AddLOD(TVMesh lodMesh, float distance) { // add lod mesh to your array or whatever you use // attach lod to main mesh with AttachTo }
public override void Render() { if (InternalData == null) return; //just to make sure our mesh!=null // determine which lod to render from distance to camera and render it }
protected override void DestroyData() { // destroy lod meshes base.DestroyData(); } }
edit: forgot DestroyData() for lod destroying  Integrated LOD system, some tutorials like this one and other stuff coming in next versions... Enjoy.
|
|
|
|
« Last Edit: February 10, 2008, 06:22:42 AM by GD »
|
Logged
|
|
|
|
|
Leon_
|
 |
« Reply #25 on: February 10, 2008, 08:01:39 AM » |
|
That's awesome! It really opens up many possibilities. Thanks! Edit: It works like a charm 
|
|
|
|
« Last Edit: February 10, 2008, 08:28:17 AM by Leon_ »
|
Logged
|
|
|
|
|
Leon_
|
 |
« Reply #26 on: February 10, 2008, 10:32:30 AM » |
|
GD, any quick way to keep specific objects enabled and in the render list although they aren't in the viewport?
When I'm in an area that is shadowed by an object and that object gets out of view I want it to stay enabled.
Setting OcclusionEnabled = false doesn't have anything to do with this, so probably somewhere else you do that boolean check (If Object is out of view then Object.Disable etc.)
Thanks.
|
|
|
|
« Last Edit: February 10, 2008, 10:37:11 AM by Leon_ »
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #27 on: February 11, 2008, 06:30:18 AM » |
|
Hmm I'm not enabling or disabling objects, just adding them to a list if they're visible. I see that you need this for stencil shadows. For shadowmapping it would be easier - frustum cull (or even occ cull if you're crazy to do it) from light's point of view to find shadow casters, or collision test with bounging-box for point lights etc. For stencils system would be different. I would need to make to test exented bounding-boxes of models and those models add to render list. Anyway, you'll have to wait a little bit. Light culling stuff is on my todo list.  edit: there's great possibility I'll implement a system for simple integrating shadow mapping algorithms, so stencils will be out. We'll see, TVSM is still unmature.
|
|
|
|
« Last Edit: February 11, 2008, 06:36:01 AM by GD »
|
Logged
|
|
|
|
|
Leon_
|
 |
« Reply #28 on: February 11, 2008, 11:03:33 AM » |
|
Ok, thank you. Take your time 
|
|
|
|
|
Logged
|
|
|
|
|
JohnB
|
 |
« Reply #29 on: March 08, 2008, 08:31:34 PM » |
|
I was just wondering if there was any news on the next TVSM release yet?
John B.
|
|
|
|
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #30 on: March 09, 2008, 09:54:58 AM » |
|
Well I fixed some bugs, raineC optimized .net code, but that seemed too small change to release it. Currently I'm working on automized shadow-mapping and ran into some problems, eveything is on hold now because of lack of my free time.
What new features would you like to see?
|
|
|
|
|
Logged
|
|
|
|
|
Raine
|
 |
« Reply #31 on: March 09, 2008, 10:12:09 AM » |
|
there was a bug in the version I sent you? oh dear ;( I guess we haven't had the time to talk about that. I think one good solution would be having a c++/cli wrapper around the native library... and that's something I'll have to work on, but not right now.
Because parsers are a pain in the butt.
|
|
|
|
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #32 on: March 09, 2008, 12:19:40 PM » |
|
ah hehe no no, bugs were in mine code
|
|
|
|
|
Logged
|
|
|
|
|
JohnB
|
 |
« Reply #33 on: March 09, 2008, 01:33:29 PM » |
|
Thanks for the update - was really just curious about how it was comming along.
It's a great project - thanks again for all your hard work!
John B.
|
|
|
|
|
Logged
|
|
|
|
xavram
Community Member

Posts: 436
|
 |
« Reply #34 on: March 10, 2008, 10:50:28 AM » |
|
GD, a question about TVSM...does it cull out objects that are behind landscapes? Like if you've got a big hill with a bunch of meshes behind the hill, does it eliminate those from the process? Or does it only do "mesh to mesh" occlusion culling?
|
|
|
|
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #35 on: March 10, 2008, 12:35:28 PM » |
|
Sure, by inheriting SceneObjectWrapper it's possible to wrap any object. I am going to add TVLandscape in next update, so yes, it's going to be included in occlusion culling process. Thanks for remining me to wrap TVLandscape.
|
|
|
|
|
Logged
|
|
|
|
|
Eric
|
 |
« Reply #36 on: March 10, 2008, 06:50:02 PM » |
|
how will that work exactly? Are you going to do some kind of horizon culling? Just curious.
|
|
|
|
|
Logged
|
|
|
|
|
GD
|
 |
« Reply #37 on: March 11, 2008, 04:17:21 AM » |
|
No special horizon techniques and stuff, landscape will be treated as any occluder since TV has very fast terrain render (plus there's LOD). Landscape will simply be rendered on culling render-surface as occluder... with depth-only shader applied and probably with LOD tuned to be faster.
|
|
|
|
|
Logged
|
|
|
|
xavram
Community Member

Posts: 436
|
 |
« Reply #38 on: March 11, 2008, 03:28:23 PM » |
|
Heh, as soon as that's added, I will be trying to incoroprate this DLL into my project!
|
|
|
|
|
Logged
|
|
|
|
WEst
Community Member

Posts: 813
Daniel Martinek
|
 |
« Reply #39 on: March 16, 2008, 09:53:52 AM » |
|
Your SceneManager is really great! I added it to my engine and it gave some significant improvements.
I would only have a small request: can you add a RenderSimpleScene command? That would render the whole visible scene using the Occlusion Meshes. In my engine I used to use proxy meshes for occlusion culling AND shadow generation.I think this would be a nice addition and hopefully not too difficult to add.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
|