[Bf-cycles] uv coordinates in Cycles standalone

Sergey Sharybin sergey.vfx at gmail.com
Wed Dec 23 12:45:43 CET 2015


This indeed seems weird and form quick glance we have to increase
index_offset by nverts[i] at the end of the outer loop.

WOuldn't have time until weekend to look deeper, mind testing such a
modification and telling if it all works correct after the change?

On Wed, Dec 16, 2015 at 1:30 AM, Guillaume Rouault <
guillaume.rouault.fx at gmail.com> wrote:

> When I look at the code here :
>
> https://developer.blender.org/diffusion/C/browse/master/src/app/cycles_xml.cpp;65ff373f0c71c043dd7b5632580501f1fc4bea7e$959
>
> what I understand is that triangles are created from the provided Ngons ,
> and the same is done with the uvs below.
> So data should be as simple as :
> - a list of vertices
> - a list of corresponding uvs.
>
> UV="
> 0.0 0.0
> 1.0 0.0
> 1.0 1.0
> 1.0 0.0
> "
> nverts="4"
> verts="0 1 2 3"
>
> and indeed, it works with a simple plane with 4 vertices.
> Problems come when I add a second polygon. What ever I do , the second
> polygon invariably gets the same coords as the first one. Thas, I REALLY
> don't understand.
>
> In cyles_xml.cpp where the uvs are created:
>
> /* loop over the triangles */
>  index_offset = 0;
> ...
> ....
> , is it normal that this variable index_offset is never incremented during
> the loop?  Isn't looping over the same polygon over and over ? (which would
> explain the uv "repetition" )
> Can somebody confirm if I am right or wrong ?
>
>
> Guillaume
>
> On Tue, Dec 15, 2015 at 4:00 PM, Nathan Letwory <nathan at mcneel.com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Hi Guillaume,
>>
>> Ah, I forgot that in my XML importer implementation (C#) I convert
>> quads to triangles. I'm looking at nverts, then if it is 4 I add two
>> triangles instead of one quad. Excuses about that.
>>
>> I don't know precisely how the C++ XML import is written, you'll have
>> to check the code for that.
>>
>> /Nathan
>>
>> On 14/12/2015 18:02, Guillaume Rouault wrote:
>> > Hi again,
>> >
>> > @Nathan, you mentionned to me somewhere that uvs a listed by
>> > triangles, but in the example file you gave me:
>> > https://github.com/jesterKing/CCSycles/blob/master/tests/objects/uv_cu
>> be.xml
>> <https://github.com/jesterKing/CCSycles/blob/master/tests/objects/uv_cube.xml>
>> >
>> >  uvs are clearly listed by squares ( 6 of them of course)
>> >
>> > To be honest, I have really hard time exporting my uvs from
>> > houdini. I've tried a lot of things already, and nothing seems to
>> > work, I am on the verge of giving up frankly, which would be a
>> > shame, because uvs are my last main issue, I have almost a basic
>> > working solution for simple animations rendering with houdini.
>> >
>> > Guillaume
>>
>>
>> - --
>> Nathan Letwory
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v2
>>
>> iQEcBAEBCAAGBQJWcCsrAAoJEKtfN7KsE0TtqCIIAL5j7pws4/n9vzLNt35k/L1t
>> rmTaGuA4ndnaLoHvJcpHEtDM93+UtXjEMvcPAbg3efr9wQCrPyrjgPa57SrFebVM
>> qf/UXYAHRipyNhQ7lXUJMo+Y9ViRIfhL8ceO0F8IX1v3VzhS93EMqhEEL3X3fRoF
>> 2OaTWTzxeFNCdy6edNVlo/VGhnuP9p0xl7ncTCrCl4+gLSDb9G9LqHsII0+09JAp
>> 2gbtnoW47rtBP4jbVYXjKIe8zah3A7KTQtwaWAgIZz3c1Fr+CbWp2qt19wfSqv2f
>> B67cTOqxV1JogUSSH9Zg1+vwwG4vx8Nobp4cagWPdLFI38mxXKmk1TZmWlC90hQ=
>> =RNxL
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> Bf-cycles mailing list
>> Bf-cycles at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-cycles
>>
>
>
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles
>
>


-- 
With best regards, Sergey Sharybin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20151223/11298ba0/attachment.htm 


More information about the Bf-cycles mailing list