www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 [Question] CustomDirSnapshot above 1024x1024 « View previous topic :: View next topic » 
Author Message
stbas
PostPosted: Sun Mar 10, 2013 3:45 pm    Post subject: [Question] CustomDirSnapshot above 1024x1024 Reply with quote



Joined: 25 Sep 2009
Posts: 9

Hi Adrian,

It's been a while since I last worked with Grome (development priorities changed, unfortunately), but I am now trying to finish a task that I started in this thread:
http://www.quadsoftware.com/forum/viewtopic.php?t=725

I've re-compiled the plug-in with the adjusted code, tested CustomDirSnapshot on exporting my map as a 1024x1024 texture and it worked like a charm (thanks a lot for implementing that function, by the way!)

However, when I try to use resolution higher than 1024x1024, instead of making the rendered image larger and more detailed, the function simply duplicates frames rendered at 1024x1024, as seen on this screenshot:
http://imageshack.us/photo/my-images/163/test12048.jpg
(screenshot illustrates a map exported at 2048x2048)

I.e. If I set the export resolution to 2048x2048 the script creates 4 frames (2x2), if I set it to 4096x4096 - 16 frames (4x4), etc.

Do you have any ideas as to what may be causing this?
Or am I simply not using the function correctly?

Code:

t_float3 dir;
dir.x = 0.4f; dir.y = -0.5f; dir.z = 0.4f;
gNormVect(dir);
if(M_FAILED(scene->CustomDirSnapshot(snapshot_handle, snapshot_min, snapshot_max, dir,
   F_SCENE_SNAPSHOT_NO_OBJS)))
{
   scene->CloseInterface();
   return C_GENERIC_ERROR;
}


Thanks in advance!

Dan
Back to top
View user's profile Send private message
stbas
PostPosted: Sun Mar 10, 2013 4:50 pm    Post subject: Reply with quote



Joined: 25 Sep 2009
Posts: 9

I think I got it!

The following constants seem to limit the snapshot size:
Code:

_const_snapshot_image_width = 1024;
_curr_snapshot_image_width = 1024;
_const_snapshot_image_height = 1024;
_curr_snapshot_image_height = 1024;

(Exporter.cpp, Lines 99-102)

All resolutions below 1024 are fine, but 2048 and higher get capped by the values defined above.

Changing these values to a higher number allowed me to export larger images.

I don't know if that's the correct way of doing it, but I guess that's one possible fix! Smile

P.S. I just realized that I've created this thread in a wrong forum.
I guess this should be in "Grome 3 - SDK Developer", sorry!
Back to top
View user's profile Send private message
ALicu
PostPosted: Sun Mar 10, 2013 5:40 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hi,

I don't have the CustomDirSnapshot plugin code on hand (is it your plugin), but I guess its code is based on the general exporter (ExpGeneral). This general exporter plugin used the variables you've mentioned in a different way. Basically if you have a very big snapshot to make (up to 512k x 512k), it creates small snapshots (one by one, row by row) of 1024x1024 and stream them out to disk into the bigger image. Probably the code was not properly adapted to the custom dir plugin? Can you send me the code of the plugin?

Thanks,
Adrian
Back to top
View user's profile Send private message
ALicu
PostPosted: Sun Mar 10, 2013 5:44 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hi again,

I see now that global plugin also has the possibility to export one snapshot per zone (rather than one big image for the entire scene as described above). So in this case the output is indeed limited to 1024. So yes, you either increase those variables values, or you can apply a similar patching method as described above (which I guess is very hard when using a custom direction).

Regards,
Adrian L.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



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 vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group