Advertisement

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

Started by February 05, 2018 08:56 PM
8 comments, last by xexuxjy 6 years, 9 months ago

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!

Doesn't this mean you just need a 3D math library?

https://glm.g-truc.net/0.9.8/index.html It's the math for OpenGL without the rendering part.

You can also learn vector math by yourself, things like ray casting is easy to learn.

Advertisement

Maybe raytracing framework like Embree or Mitsuba.

Sounds like a physics engine, and Bullet physics is the best of the open source ones.

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?

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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.

Advertisement

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.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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

 

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.

This topic is closed to new replies.

Advertisement