Author Topic: How to make a device that can tiled build?  (Read 3097 times)

0 Members and 1 Guest are viewing this topic.

dagri

  • Community Member
  • **
  • Posts: 9
    • View Profile
How to make a device that can tiled build?
« on: November 22, 2010, 04:56:13 AM »
Hello,

I made a my device. and it works well.

I want to make the device for tiled build.

I changed below code.

   
Code: [Select]
virtual bool isExporting(OUTPUT_MODE mode) { return false; }to
   
Code: [Select]
virtual bool isExporting(OUTPUT_MODE mode) { return true; }

and I found some problem.

Code: [Select]
doOutput(OutputSet& outset, OUTPUT_MODE output_mode)
output_mode value has OUTPUT_TILED.
but outset value has strange value.

How to make a device that can tiled build?

Remnant

  • Author
  • World Machine Guru
  • *****
  • Posts: 2311
    • View Profile
    • http://www.world-machine.com/
Re: How to make a device that can tiled build?
« Reply #1 on: November 22, 2010, 05:44:14 PM »
The OutputSet encapsulates all of the data inputs that are active going into your Output device. Thus if your output takes many inputs and produces a single file, it will be provided with
all of those inputs which can be retrieved by iterating over outset.get(x) where x is in 0..outset.num()

OutputSet &outset should contain a reference to an OutputSet object (defined in IODevices.h)  that you can use to retrieve your data for saving, for example:

Code: [Select]
HField *hf = HF(outset.get(0)); // retrieve a heightfield type input

If your not seeing a valid OutputSet object on the outset parameter, we then have a different issue at hand!
-- Stephen Schmitt
- Creator of World Machine

dagri

  • Community Member
  • **
  • Posts: 9
    • View Profile
Re: How to make a device that can tiled build?
« Reply #2 on: November 22, 2010, 07:02:46 PM »
I made simple logging code for test the outset value.

Code: [Select]
#include <fstream>
bool SimpleOutput::doOutput(OutputSet &outset, OUTPUT_MODE output_mode) {
assert(false && "TODO: doOutput() implementation!");
// TODO: DO YOUR OUTPUT!

std::ofstream of;
of.open("check outset value.txt", std::ios_base::out | std::ios_base::app);

if (output_mode == OUTPUT_TILED)
{
int n = outset.num();
of << "tiled outset num : " << n << std::endl;
}
else
{
int n = outset.num();
of << "normal outset num : " << n << std::endl;
}

return false;
};

and I built each way.

it's a result.
Quote
normal outset num : 1
tiled outset num : -10942447
tiled outset num : 525928465
tiled outset num : -10942447
tiled outset num : 525928465

I think outset value broken.

My computer spec is below
compiler : VS 2008, compile option release x64.
cpu : Intel Core2 Quad CPU Q8200
OS : windows 7 64bit
memory : 8GB



Could you send me sample code can tiled build device?
« Last Edit: November 22, 2010, 07:20:03 PM by dagri »

Remnant

  • Author
  • World Machine Guru
  • *****
  • Posts: 2311
    • View Profile
    • http://www.world-machine.com/
Re: How to make a device that can tiled build?
« Reply #3 on: November 23, 2010, 03:18:52 PM »
hmm. I just performed a check by essentially copy-pasting your doOutput function and it works successfully for me using the 2.2 PDK and WM 2.2 Pro executable.

The only unaccounted for variable is that different versions of the MSVC compiler can break binary compatibility with libraries -- I've noticed this in particular with the STL implementation changing between editions. C++'s lack of a native ABI is what really hurts here.  If you can get your hands on the VC2005 compiler, my suspicion is that your code will work successfully.
-- Stephen Schmitt
- Creator of World Machine

dagri

  • Community Member
  • **
  • Posts: 9
    • View Profile
Re: How to make a device that can tiled build?
« Reply #4 on: November 24, 2010, 06:27:49 AM »
I changed my compiler to 2005.

It works well. Thank you. :D