Hi Imran,
I tried the Build Texture Atlas filter and I always get the message Failure
of Filter: "Build texture atlas".
Can you host somewhere the objects that worked for you?
bye
Sebastian
2008/7/22 skunkwerk <sku...@gm...>:
> team,
> i've fixed 2 rather insidious logic bugs in my texture atlas and
> committed the changes:
>
>
> - uv coordinates need to be converted to their corresponding positive
> values BEFORE the triangle spans are calculated
> - i wasn't storing the maximum span, but rather the span of the last
> triangle to be iterated... dumb mistake
>
> i've tested on about 10 models, it hasn't crashed (at least with the
> default 'copied tiles'), and the UV coordinates are now always between 0 &
> 1. in 2 of the cases it failed because the textures couldn't fit in the
> default size due to tiling.
>
> i'll try some simple models (a box with 6 textures) to make sure the
> mapping is correct...
>
> 1) can someone confirm that a uv coordinate of -1.6 is equivalent to a
> positive uv coordinate of 1.4?
>
> thanks,
> imran
>
>
> On Sun, Jul 20, 2008 at 4:11 PM, skunkwerk <sku...@gm...> wrote:
>
>> thanks paolo... sorry, that was a typo. the exact same code works in the
>> colladaformat.h file, but not in my filtertexture.cpp file - any idea why?
>>
>>
>> On Sat, Jul 19, 2008 at 9:57 PM, Paolo Cignoni <pao...@is...>
>> wrote:
>>
>>> In this mail you wrote
>>>
>>> CMesh<zero> instead of CMesh<Capital O>
>>>
>>> check that you did not the same in the code...
>>>
>>> p.
>>>
>>>
>>>
>>> skunkwerk wrote:
>>>
>>> yeah, i read the wiki and looked at my own source code.
>>>
>>> this used to work as of a few months ago:
>>> vcg::tri::Allocator<CMesh0>::CompactVertexVector(m);
>>> but isn't anymore...
>>>
>>> the compiler says the candidate function is the same thing...
>>>
>>> 2008/7/17 Paolo Cignoni <pao...@is...> <pao...@is...>:
>>>
>>>
>>>
>>> skunkwerk wrote:
>>>
>>> i've updated and committed the texture atlas filter
>>>
>>> 1) i've removed the extraneous code so it doesn't bother trying to create
>>> multiple atlases now
>>> 2) i make any negative UV coords positive before I try to offset them, as
>>> it's easier to figure out that way. i've also fixed some code in
>>> adjustUVCoords so it's a bit more straightforward now
>>> 3) i couldn't find the "updateTexture" slot you mentioned, Paolo. did you
>>> mean the updateGL() slot in mainwindow?
>>>
>>>
>>> it is a slot of the GlArea not of the main window. So it could be an issue
>>> since from within a filter you should not know a lot of the glarea....
>>> I will add a solution to this.
>>>
>>> 4) i'm still not sure what the correct syntax is for compactfacevector,
>>> etc. so it's commented out right now
>>>
>>> It is explained in the vcg wiki
>>> http://vcg.sourceforge.net/index.php/Allocation
>>>
>>>
>>> Cheers
>>> p.
>>>
>>>
>>>
>>>
>>> it compiles... but i'll test it tomorrow morning
>>>
>>> On Thu, May 22, 2008 at 3:42 PM, skunkwerk <sku...@gm...> <sku...@gm...> wrote:
>>>
>>>
>>>
>>> thanks Paolo,
>>> i've commited a new version:
>>>
>>> 1) the reason for multiple texture atlases was that some platforms cannot
>>> support very large textures - but i've changed the default texture size to
>>> 4096x4096
>>> 2) i've split up the code into 5 separate functions
>>> 3) i'm using stl's min/max now
>>> 4) i tried calling the compactface function but was getting an error and
>>> have commented it out for now - what's the correct way to do this?
>>> 5) i'm aware of the floor and ceiling functions, but didn't see any place
>>> in the code i could have used it
>>>
>>> imran
>>>
>>> On Wed, May 21, 2008 at 11:03 PM, Paolo Cignoni <pao...@is...> wrote:
>>>
>>>
>>>
>>> skunkwerk wrote:
>>>
>>> i've made further changes to the texture atlas plugin - it should now
>>> work with negative uv coords. it is crashing, however on line 197:
>>>
>>> it causes a segmentation fault, that i've backtraced to qpainter. This
>>> does not crash when I do not try to scale the qimage before converting it to
>>> a qpixmap. any suggestions? I've tried calling the qpainter destructor
>>> before resizing, but that doesn't help.
>>>
>>> http://meshlab.svn.sourceforge.net/viewvc/meshlab/trunk/meshlab/src/meshlabplugins/filter_texture/filter_texture.cpp?revision=2258&view=markup
>>>
>>>
>>>
>>>
>>> imran
>>>
>>>
>>> I gave a very short look at the code.
>>> A few suggestions (that in most cases holds for all my students too....)
>>>
>>> - keep the implementation of the filters out of the apply methods unless
>>> it is a very short one (e.g. less than 10~20 lines of code). The ApplyFilter
>>> function should be mostly a switch.
>>> - try to structure your code a little more. Avoid very lengthy functions.
>>>
>>> - multiple atlases seems to me a bit a weird concept. The idea of atlases
>>> is exactly the fact of having a single unique object. Let us assume that the
>>> objective is an unique single atlas.
>>> - You are doing a quite restructuring algorighm so it reasonable an
>>> initial purging step. Perform at beginning a compactVertex and comapctface
>>> call and get rid of all the IsD() tests in your loops.
>>> - Do not take any care of number of multiplications, sums and operations.
>>> Performance is affected by other things. Forget old style optimizations....
>>> - stl has min and max, use them.
>>> - pay attention to use int for truncating a value, floor and ceil make a
>>> more predictable work, particualrly when negative numbers are around
>>> - 2880 seems to me a quite weird value for a maximum texture size. Where
>>> do it came from? why not a plain 4096 or 8192?
>>> - on my machine, on the input mesh sample/texture_double.ply it does not
>>> crash, but simply create trashed tex coords. From the log:
>>>
>>> created atlas of dimensions: 1024 , 512
>>> inserted texture 0 into atlas at position: 0 0
>>> inserted texture 1 into atlas at position: 512 0
>>> saved texture atlas
>>> original U: 0 original V: 0
>>> new U: 2.82017 new V: 9300.4
>>> original U: 1 original V: 0
>>> new U: 2.82017 new V: 9300.4
>>> original U: 1 original V: 1
>>> new U: 2.82017 new V: 9300.41
>>> original U: 0 original V: 0
>>> ...
>>>
>>>
>>>
>>>
>>> Cheers
>>>
>>> p.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Paolo Cignoni -- Senior Researcher
>>> Visual Computing Laboratory - ISTI - CNR http://vcg.isti.cnr.it/~cignoni <http://vcg.isti.cnr.it/%7Ecignoni> <http://vcg.isti.cnr.it/%7Ecignoni> <http://vcg.isti.cnr.it/%7Ecignoni>
>>>
>>>
>>>
>>>
>>> ISTI - CNR
>>> Via Moruzzi 1,
>>> 56124 Pisa
>>> ITALY
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Meshlab-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>>>
>>>
>>> ------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> Meshlab-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>>>
>>>
>>>
>>> --
>>> Paolo Cignoni -- Senior Researcher
>>> Visual Computing Laboratory - ISTI - CNR http://vcg.isti.cnr.it/~cignoni <http://vcg.isti.cnr.it/%7Ecignoni> <http://vcg.isti.cnr.it/%7Ecignoni> <http://vcg.isti.cnr.it/%7Ecignoni>
>>>
>>>
>>>
>>> ISTI - CNR
>>> Via Moruzzi 1,
>>> 56124 Pisa
>>> ITALY
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Meshlab-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>>>
>>>
>>> ------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> Meshlab-devel mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>>>
>>>
>>>
>>> --
>>> Paolo Cignoni -- Senior Researcher
>>> Visual Computing Laboratory - ISTI - CNR http://vcg.isti.cnr.it/~cignoni <http://vcg.isti.cnr.it/%7Ecignoni>
>>>
>>> ISTI - CNR
>>> Via Moruzzi 1,
>>> 56124 Pisa
>>> ITALY
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Meshlab-devel mailing list
>>> Mes...@li...
>>> https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>>>
>>>
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Meshlab-devel mailing list
> Mes...@li...
> https://lists.sourceforge.net/lists/listinfo/meshlab-devel
>
>
|