It is currently Sat Aug 22, 2020 3:51 pm


All times are UTC




Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: Re: First questions :)
PostPosted: Sun Jun 06, 2010 10:26 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
[WuTz]! wrote:
I found the first one before, and with this it seemed to work (Where is number 2?).

Number 2 is in GradiantEstimators.h/.cpp. I need to do some work to reorganise this normal calculation code...

[WuTz]! wrote:
I don't think that the problem lays at the smoothing anymore, but at "my" stupid intersector. :(
Well, when I ported my engine from DX10 to DX11, the useful intersect-function of D3DX10 was gone (Microsoft, damn!) and I wanted to get everything running again. So I just copied it out of a SDK sample. And what can I say? That function is *really* stupid. I could have wrote the code myself, so often I needed to change something on it. It is only a piece of ... . And I really need to change it. My artist complaint about this, too. When you are inside something, it doesn't selects anything. I'll implement the voxel.method for the terrain. Everything should be better than that what I currently have.


Yeah, I heard about Microsoft removing that from the SDK. A lot of people complained. But the voxel method is pretty robust, and as well as responing to mouse clicks I have used it to ensure the camare doesn't fly into the object. It works well.

[WuTz]! wrote:
I'm going to set up a newspage at ModDB (http://www.moddb.com/engines/wtech) about the new PolyVox terrain soon. Maybe I need some deeper information about PolyVox then. And, since I want to add the DX11 port to it (Wohoo new DX! <- Gamers will say) I expect a high click-count. Would be a nice advertising for PolyVox, I think :)


Sounds good! The best simple introduction (i.e. suitable for gamers) I have is here: http://www.thermite3d.org/joomla/index. ... &Itemid=33

For more technical details there is only the book article I wrote for Game Engine Gems 1. Also, you can mention how voxels were used for terrain in Crysis, iD Tech 6, etc :-)

EDIT: Oh, one other thing, If you are looking to promote your project a bit I have a page of projects using PolyVox:

http://www.thermite3d.org/joomla/index. ... &Itemid=28

Just let me know if you want to be on it.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Fri Jun 11, 2010 9:59 pm 

Joined: Wed Jun 02, 2010 8:52 pm
Posts: 37
Quote:
Just let me know if you want to be on it.


Sorry, I had no time, for the news, because we are setting up our second techdemo at the moment. Nothing with polyvox yet (It has the ability to use it, though), but more about features like Deferred Rendering or blooming. I'm working on the intro-screen (Where you can set the options, etc..) right now. The map is finished. Our deadline for that is the next Sunday, and after that I will be working with PolyVox again. :)

Just wanted to let you know...


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Sun Jun 13, 2010 10:49 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Sure, no problem. I know that these things take a lot of time! I'll get some of your suggested improvements into PolyVox over the next week or so.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Sun Jun 13, 2010 9:01 pm 

Joined: Wed Jun 02, 2010 8:52 pm
Posts: 37
So, Techdemo is finished and uploaded: http://www.moddb.com/engines/wtech/news ... o-released
If you don't see it, try again later. Maybe it still needs to be authorized.
However, I am working with PolyVox again, and I got stuck with implementing the Voxel-Intersection function. I'm not very good at these things about intersection. I have a rough idea how I have to do it, but it just isn't working correctly. Could you post your function, so that I can take a look at it?

And I also found out how to speed up the std::foo things:
#define _SECURE_SCL 0

will make them faster in release builds. This is even activated there, not just in debug ones.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Mon Jun 14, 2010 5:32 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
[WuTz]! wrote:
So, Techdemo is finished and uploaded: http://www.moddb.com/engines/wtech/news ... o-released
If you don't see it, try again later. Maybe it still needs to be authorized.


I tried it - it looks nice! The parallax mapping is particularly pretty. And I like the way the candles flicker in time with the music :-) Only problem was the movement was really slow... maybe it's dependant on framerate?

[WuTz]! wrote:
However, I am working with PolyVox again, and I got stuck with implementing the Voxel-Intersection function. I'm not very good at these things about intersection. I have a rough idea how I have to do it, but it just isn't working correctly. Could you post your function, so that I can take a look at it?


Yep, this is copied directly from Thermite. It uses some Ogre classes but hopefully you get the idea:

Code:
std::pair<bool, Ogre::Vector3> ThermiteGameLogic::getRayVolumeIntersection(const Ogre::Ray& ray)
   {
      //Initialise to failure
      std::pair<bool, Ogre::Vector3> result;
      result.first = false;
      result.second = Ogre::Vector3::ZERO;

      //Ensure the voume is valid
      PolyVox::Volume<uint8_t>* pVolume = mMap->volumeResource->getVolume();
      if(pVolume == 0)
      {
         return result;
      }

      Ogre::Real dist = 0.0f;
      for(int steps = 0; steps < 1000; steps++)
      {
         Ogre::Vector3 point = ray.getPoint(dist);
         PolyVox::Vector3DUint16 v3dPoint = PolyVox::Vector3DUint16(point.x + 0.5, point.y + 0.5, point.z + 0.5);
         bool inside = pVolume->getEnclosingRegion().containsPoint(static_cast<Vector3DInt16>(v3dPoint), 2);
            
         if((inside) && (pVolume->getVoxelAt(v3dPoint) != 0))
         {
            result.first = true;
            result.second = point;
            return result;
         }

         dist += 1.0f;         
      }

      return result;
   }


Just ask if you want some more details...

[WuTz]! wrote:
And I also found out how to speed up the std::foo things:
#define _SECURE_SCL 0

will make them faster in release builds. This is even activated there, not just in debug ones.


It seems from the docs that that disables range checking on iterators, but I'm not sure that will make much difference to PolyVox. Still a useful tip though :-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Mon Jun 14, 2010 6:30 pm 

Joined: Wed Jun 02, 2010 8:52 pm
Posts: 37
Quote:
I tried it - it looks nice! The parallax mapping is particularly pretty. And I like the way the candles flicker in time with the music :-) Only problem was the movement was really slow... maybe it's dependant on framerate?


Thank you! :) Yeah, the movement is somewhat slow, but not depending to the framerate. My artist just built the world way to big, because you are faster with the editors mouse movement. I'll make the demo-cam faster.

Quote:
Just ask if you want some more details...


I ask :)
Code:
void WVoxelTerrainComponent::DoTrace(D3DXVECTOR3 Start,D3DXVECTOR3 Dir,D3DXVECTOR3* Hit,float* Dist)
{
   //Initialise to failure
   bool bHit=false;
   D3DXVECTOR3 HitLocation=D3DXVECTOR3(0,0,0);


   float ChkDist = 0.0f;
   for(int steps = 0; steps < 1000; steps++)
   {
      D3DXVECTOR3 point=Start+(Dir*ChkDist);
      
      PolyVox::Vector3DUint16 v3dPoint = PolyVox::Vector3DUint16(point.x + 0.5, point.y + 0.5, point.z + 0.5);
      bool inside = VoxelVolume->getEnclosingRegion().containsPoint(static_cast<Vector3DInt16>(v3dPoint), 2);

      if((inside) && (VoxelVolume->getVoxelAt(v3dPoint) != 0))
      {
         *Hit=point;
         *Dist=ChkDist;
         return;
      }

      ChkDist += 1.0f;         
   }

   *Hit=D3DXVECTOR3(0,0,0);
   *Dist=-1; //-1 says: no hit
}


This is what I made of your code.And I encountered a problem: It doesn't works! :D

I converted my Start-position and the Ray direction to object space before, is this correct?
And one more: Do you see any mistakes, I might made?

Quote:
It seems from the docs that that disables range checking on iterators, but I'm not sure that will make much difference to PolyVox. Still a useful tip though :-)


Every unimportant lesser is good in release builds. :) This will make every access to things like std::vector faster, because it doesn't checks if it's n valid rage (Which should the application do!)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Mon Jun 14, 2010 9:32 pm 

Joined: Wed Jun 02, 2010 8:52 pm
Posts: 37
Okay, got it working now. There is still some issue when trying to select it from distance, but I know where to look to solve this.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Mon Jun 14, 2010 9:43 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
[WuTz]! wrote:
Okay, got it working now.

Sorry, I was just too slow to reply!
[WuTz]! wrote:
There is still some issue when trying to select it from distance, but I know where to look to solve this.

Yeah, maybe you just need to make it take more steps. That code I gave certainly isn't perfect but it was good enough for my purposes. A faster and more robust approach would be to perform something like Bresenham's line algorithm in 3D.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Mon Jun 14, 2010 10:34 pm 

Joined: Wed Jun 02, 2010 8:52 pm
Posts: 37
I just do Length(RayStart)*Length(Scale) steps. Works good for me, too. But I just found our, that this isn't working in release mode. :cry: Time for bed.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: First questions :)
PostPosted: Tue Jun 15, 2010 5:50 pm 

Joined: Wed Jun 02, 2010 8:52 pm
Posts: 37
So, I slept over it, and I solved it. Hadn't anything to do with the release mode, just a ugly and hard to find mistake by me. While I was trying to fix it, I noticed something in your library, which could be a bug:

Code:
bool inside = VoxelVolume->getEnclosingRegion().containsPoint(static_cast<Vector3DInt16>(v3dPoint), 2);


This line, will also reject any voxels at position 0. No matter if X=0 or Y=0 or Z=0, it will be signed as outside.

And oh, I forgot about something:
Quote:
EDIT: Oh, one other thing, If you are looking to promote your project a bit I have a page of projects using PolyVox:

http://www.thermite3d.org/joomla/index. ... &Itemid=28

Just let me know if you want to be on it.


I will do that, but not yet. [w]tech uses PolyVox, though, but there isn't much it does with it (Just a simple voxel placer for testing). But I'm working on a real voxel editor for it right now. When this gets usable, and I am able to show some nice screenshots, I will write this article :) (Could be in 1-2 weeks I think)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net