[Bf-committers] Subsurf + UVmap, an alternative solution

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Nov 11 16:25:29 CET 2005


Hi,

Ton Roosendaal wrote:
> Hi Brecht,
> 
> Code for getting the subsurfed vertex coordinates of the original 
> vertices is not that easy. You cannot use the callback getVertexCos() 
> because it won't exist for subsurfs (the vertexco array then would be a 
> mix of original and new vertices anyway).
> 
> Instead Daniel coded a callback system, I use that for example for 
> weightpaint and vertexpaint like this function;
> 
> src/vpaint.c
> static float *get_mapped_verts_nors(Object *ob, int totvert)
> 
> This can be copied for doing the LSCM as well.
> 
> Now we should also note that the API for derivedMesh is a bit unclear at 
> the moment... the calls are too much low level, and not always clear 
> what they do. Hopefully Daniel has some time later to clarify issues. :)
> A call like I mention above could be in DerivedMesh.c, so it can be used 
> by all calls in Blender needing these coords (particles need it too).

As I stated earlier, getting the subsurfed coords for LSCM is not
the best solution. This would only be an approximation, and still
result in distortion. It's better to have it do smooth interpolation
in the subsurf code itself.

I have code for this, it just doesn't work nice with seams. I tried
creasing them, but that only fixed half of the problems and made
some worse.

Committing the code I have now would already be better than
using subsurfed coords for LSCM, but I still think I can make it
also interpolate nicely near seams.

Brecht.

> -Ton-
> 
> 
> 
> On 30 Oct, 2005, at 21:43, Jean-Luc Peurière wrote:
> 
>>
>> Le 30 oct. 05 à 21:01, Frédéric van der Essen a écrit :
>>
>>>
>>>
>>>> I also think that the amount of distortion induced by the first case
>>>> is much more than the second.
>>>>
>>>
>>> If the cage is not dense and there is a lot of tris, the distortion 
>>> due to the second can be very bad, and a lscm mapping for 
>>> innervertices give perfect results even if the mesh has the most 
>>> crazy topology you can imagine.
>>>
>>
>> yes worst case scenario, but cannot be phased out, you are right.
>>
>> Still, the 1st problem is the most prevalent.
>>
>> Now, we need Brecht and/or zr take care of that. They both own parts 
>> of the code in cause
>>
>> -- 
>> lukep_______________________________________________
>> Bf-committers mailing list
>> Bf-committers at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-committers
>>
> --------------------------------------------------------------------------
> Ton Roosendaal  Blender Foundation ton at blender.org http://www.blender.org
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
> 
> 



More information about the Bf-committers mailing list