Author Topic: VoxelShop - voxel editor  (Read 14216 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #15 on: December 05, 2013, 07:59:16 am »
I was already using multiple threads. Disabling it for the clearing increases the time from 14 to 20 ms. So that's not helping. Guess I will have to accept it. Could you explain what is happening when clearing? As I understand it, it's "just" deleting all the old data and (re)initializing the data structure. Why is that taking such a long time (I'm just curious)?
Actually not much. It's clearing two buffers (color and depth) and some internal data structures for HSR and things like that. However, @2000*1000, each buffer has 2,000,000 pixels which means 8,000,000 bytes. So these two buffer alone have 16mb to be cleared. That simply takes it's time...
Is there a way to determine what the bottle neck is? Considering that the optimization I have in mind is far from trivial I'd be nice to know if it's worth it. If you can think of an easy way to add profiling, that would be very much appreciated!
I would create a simple test case for this. Just render a large cube filled with small cubes and another one where you are rendering the hull only and you should get a pretty good approximation of what to expect.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #16 on: December 05, 2013, 08:05:37 am »
BTW: I'll give some idea try and see if that helps...i'll report back.

Edit: Looks promising...i'll try to add my idea to the engine and see if that helps in your case.

Edit 2: No, it's not worth it. It might have been for clearing a single buffer, but accessing two of them renders it almost useless... :(
« Last Edit: December 05, 2013, 08:44:39 am by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #17 on: December 05, 2013, 09:09:53 am »
Which sampling mode are you actually using? Are you using oversampling?

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #18 on: December 05, 2013, 11:55:26 am »
Thanks for the explanation! I still think that there must be a way to allocate and initialize the memory twice and then just do a low level copy that overwrites the changed buffer memory using the second initialization. But in Java that might not be easy to do.

I've already started with the optimization I was planning to do. My test showed that it is helping in certain scenarios. Will report back when I have it working!

@Sampling: I'm using SAMPLINGMODE_OGSS. The other sampling modes were producing way too many "pixel".

This is my config initialization btw. Any suggestions for changes?

Code: [Select]
Config.fadeoutLight = false;
Config.useMultipleThreads = true;
Config.maxNumberOfCores = Runtime.getRuntime().availableProcessors();
Config.loadBalancingStrategy = 1;

Config.useMultiThreadedBlitting = true;

Config.mipmap = true;
Config.texelFilter = false;

Logger.setLogLevel(Logger.ERROR);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #19 on: December 05, 2013, 12:47:14 pm »
@Sampling: I'm using SAMPLINGMODE_OGSS. The other sampling modes were producing way too many "pixel".
Well, in that case, you aren't clearing 16mb but 64mb of data in each frame.

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #20 on: December 05, 2013, 01:37:41 pm »
@Sampling: I'm using SAMPLINGMODE_OGSS. The other sampling modes were producing way too many "pixel".
Well, in that case, you aren't clearing 16mb but 64mb of data in each frame.

Yeah, that makes sense. I set it to SAMPLINGMODE_NORMAL and it's much faster, but looks very rough.

Any idea how to get the "outlines" smoother (the black outline of the voxel in the screenshot here http://blackflux.com/software/vs/other/tree.jpg )? I could live with rougher voxels, but if the outline looks pixelig that is bad. Currently I'm using setAdditionalColor and a transparent texture with a black frame. I was thinking to use the drawWireframe method instead, since that is very fast. However it draws the triangles (obviously) and not only the "outline".

Thanks for all your input so far! I really appreciate it!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #21 on: December 05, 2013, 04:56:34 pm »
You could try OGSS_FAST instead. It's a compromise between speed and image quality.

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #22 on: December 11, 2013, 10:41:09 pm »
Reducing the triangle count made a huge difference. The program is now a pretty neat tech demo and, more importantly, quite fast! Work continues =)



Thanks for all the support!

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #23 on: December 14, 2013, 10:51:50 pm »
Just a quick update.

I've improved the "hull detection" and tested with large amount of voxels. At 63 ^ 3 = 250047 voxel it was getting a bit laggy. Also I think I need to adjust the heapspace (and rewrite the voxels data structure to be more memory/speed efficient). But pretty happy so far!



(click to enlarge)


Note: You can also see that the triangle count was exceeded (the selection doesn't show all triangles in the right bottom corner).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #24 on: December 16, 2013, 10:14:24 pm »
I've finally managed to add it to the projects page.

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #25 on: December 22, 2013, 10:59:43 pm »
Cool, looks good!

Is there a way to create a frame buffer that allows for rendering with different sampling modes? Or do I have to create two instances (seems like it's redundant, memory wise)?

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #26 on: February 08, 2014, 08:31:02 pm »
Created a new promo page. Certainly worth checking it out again!

Click me!


Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Re: VoxelShop - voxel editor
« Reply #27 on: February 09, 2014, 06:07:17 am »
Does this application have the option to export any created models into a jPCT usable format?

Offline aZen

  • int
  • **
  • Posts: 94
    • View Profile
Re: VoxelShop - voxel editor
« Reply #28 on: February 09, 2014, 06:13:30 am »
Does this application have the option to export any created models into a jPCT usable format?

You can export to COLLADA, so yes.

Nvm, the COLLADA importer doesn't ship with jpct. So no, unfortunately atm you would need to convert the output (should be easy and fast, e.g. with blender) before you can import it to jpct.

Other formats are on my todo list though!
« Last Edit: February 09, 2014, 07:34:04 am by aZen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: VoxelShop - voxel editor
« Reply #29 on: February 09, 2014, 07:47:04 pm »
The new promo page looks nice!