• Advertisement

A 3D engine that doesn't render...

Recommended Posts

Hi All, 

I have a rather strange requirement. I need a simple 3D worldspace engine, that can position and scale 3d models/meshes, cast rays between them. But NOT render anything!

Sounds weird I know, but I need to run simulations on visibility (hence the ray casting) in a 3d world as quickly as possible. I don't need physics, networking, sound, user input and no output will ever be rendered.

Does anyone know of a library or engine that can meet this requirement? To complicate things further the rest of the Application is written in .Net Core 2.0. so one which is compatible with that would be most useful.

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
2 hours ago, Ashthos2 said:

Sounds weird I know, but I need to run simulations on visibility (hence the ray casting) in a 3d world as quickly as possible.

It might result in better suggestions if you explain at a high level what you are trying to accomplish.

Is this for computing lightmaps? Server-side visibility queries for a multiplayer game? Some sort of path finding?

Share this post


Link to post
Share on other sites
3 minutes ago, swiftcoder said:

It might result in better suggestions if you explain at a high level what you are trying to accomplish.

Is this for computing lightmaps? Server-side visibility queries for a multiplayer game? Some sort of path finding?

This is a server side simulation that will be run against a set of varying parameters many times (think MonteCarlo). I therefore need it to run as fast as possible to keep the server time down. 

Raycasting is required as essentially the simulation boils down to whether or not the objects can see any part of the other given the inclusion of other world objects or models.

This is a simplified version of the tests the application will be performing, I've omitted a lot of the specifics because they add noise to the base requirement to be able to place the 'models' in the 3d space and cast rays from one to the other to check ray intersection.

Share this post


Link to post
Share on other sites

Ok, so effectively you want to check occlusion of models in the scene? And this requires testing against the actual geometry, not just the bounding volumes thereof?

A full ray tracer may be overkill, since you don't need any of the complex parts (i.e. shading). Occlusion in real-time 3D renderers is mostly done by rasterisation, rather than ray casting.

Your best bet might be to repurpose the ray cast vs mesh portion of a physics engine.

Share this post


Link to post
Share on other sites

Feeled of an age ago I did something like this (for testing if a mesh could be rendered and skip it otherwise) by simply using
gluUnProject, an untransform operation based on current matrices. This could be a starting point to build a function that tests a given set of vertices against a transformation matrix to test if any of them is in view

 

Share this post


Link to post
Share on other sites

If you need .NET compatibility, I ported Bullet Physics to XNA a while back, (https://github.com/xexuxjy/bullet-xna) , or you can use a c# binding such as Bullet Sharp (https://andrestraks.github.io/BulletSharp/) . It should do pretty much what you need and doesn't expect any form of renderer, though you can attach a simple debug renderer for testing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement