Tene
Hello,

We have a custom engine trying to integrate Voxelfarm into it, and I was curious if it is possible to input models into the Voxelfarm rendering without them being 'voxelized' and perhaps how this is possible in code.

https://voxelfarm.helpdocsonline.com/importing-assets

The page says:
"Depending on where the prefab program will be run, it may be required that all the assets used are compatible with voxelization."

This makes me assume that there are scenarios where we can import models without them being voxelized, this would be useful for for instance player models, which are dynamic in the scene.
So, is this possible and if so, how would one decide this voxelization process in code?

Thanks,

Tene
0 0
voxelfarmtorres
The broad answer is yes, you do not need to voxelize everything. You get to decide what will be voxelized and what will render as a native mesh.

In particular, the way this works is you can execute a prefab program in your application. For each instance that the prefab generates, your application will receive a callback telling you which instance was generated and where it should go, which size, rotation, etc. At this time, you can choose to voxelize the instance, or simply record its occurrence, and render the instance using the native mesh rendering provided by your custom engine.
1 0
Tene
Hello,

So we have had some progress now since the last post, and we have succeeded in inputting models in the VoxelFarm renderer.

However, just to be sure, I would want verification if it is possible to actually render 'non-voxelized' models via the VoxelFarm renderer, as your comment "and render the instance using the native mesh rendering provided by your custom engine" would state that this is not possible. This would also mean that we would have to send your shaders both through VoxelFarm and our custom engine separately, and shadows for example would then need to be generated separately on the VoxelFarm side and on our custom engine side, is this correct?

Thanks,

Tene
0 0
voxelfarmtorres
Voxel Farm's OpenGL renderer can render both voxel and traditional polygon models.

In general, you should use only one rendering engine. If you already have a rendering system, and you want to keep it, you will not need to use any of Voxel Farm's rendering code. In particular, if your renderer can render traditional (non-voxelized) meshes, Voxel Farm does not need to be involved at all in that part of your rendering pipeline. If you want instances like trees and bushes, for example, Voxel Farm can provide you with the coordinates for the instances. How you draw the actual meshes in position, it is something your graphics engine will do for you.
0 0
Tene
And what function would I need to call to render non-voxelized models? Would it also be possible to import .fbx files (or perhaps a similar extension for models) to render? And if so, what function would I need to call for that?
0 0
voxelfarmtorres
If you do not mind, I think we need some more background on your project.

In your original post, you mentioned "We have a custom engine trying to integrate Voxelfarm into it". I assumed this was a graphics/game engine. Can you elaborate what it is you are integrating Voxel Farm into?
0 0
Tene
Yes, our custom engine is a game engine. This means we currently have a graphics pipeline as well, but for now, we will want to use the Voxel Farm's graphics pipeline, as:
1. It has more possiblities than our current engine.
2. We are close to a deadline and want results pretty soon.
In other words, for now it just needs to work.

As you mentioned it is possible to render both voxelized and non-voxelized models through Voxel Farm, if we would be able to know what function call is required for rendering non-voxelized models, and if / how it is possible to import .fbx models to render, this would greatly speed up our work process.
0 0
voxelfarmtorres
Understood. Please note Voxel Farm's rendering uses OpenGL. That means your application will be using OpenGL.

The Voxel Farm SDK contains an example of how the renderer is used. The example project is VoxelFarmDemoBundled

This example loads a bundle exported from Voxel Studio and renders the scene. You will see the graphics part of the engine is rather simple to set up. You need this call to set up the window that will contain the render: 

VoxelFarm::GL::CreateGLWindow("VoxelFarm GL Demo", xres, yres, 32, VoxelFarm::GL::fullscreen, WndProc, false, hostHWND)


If you have questions about the parameters we can provide more info.

You must have calls to configure the render settings, load shaders and load voxel material textures.

Then, in your application's message loop, you must call the engine to render a frame:

VoxelFarm::GL:😃rawGLScene(clipmapView)


In order to render your custom objects, you will receive two callbacks from the rendering engine: VoxelFarm::GL::beforeRender and  VoxelFarm::GL::afterRender

Here you are in OpenGL land, so you can use your own GLSL shaders and custom geometry.
0 0
Tene
Alright, thanks for the info.

I currently do not have access to this code; my other team member has got the license.
However, he mentioned me GL::beforeRender and GL::afterRender include no actual render code, which means we would have to include our own custom code to render our custom geometry, is this correct?
I understood from you that Voxel Farm has functionality to render custom geometry and that we would not have to include custom code.
0 0