Results 1 to 2 of 2

Thread: How to correctly reference a texture image

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    4

    How to correctly reference a texture image

    Hello,

    I found this code in a COLLADA 1.5.0 document (Shortened so it only includes the related stuff):

    Code :
    <library_images>
      <image id="photo">
        <init_from><ref>photo.jpeg</ref></init_from>
      </image>
    </library_images>
    <library_effects>
      <effect>
        <profile_COMMON>        
          <technique sid="standard">          
            <phong>
              <diffuse>
                <texture texture="photo" />

    Is this a valid COLLADA 1.5.0 texture reference? The spec says that the texture attribute references a parameter with a sampler2D element which then instantiates an image (With instance_image element). So in my opinion THIS is the correct way to do it:

    Code :
    <library_images>
      <image id="photo">
        <init_from><ref>photo.jpeg</ref></init_from>
      </image>
    </library_images>
    <library_effects>
      <effect>
        <profile_COMMON>        
          <newparam sid="photo">
            <sampler2D>
              <instance_image url="#photo" />
            </sampler2D>
          </newparam>      
          <technique sid="standard">          
            <phong>
              <diffuse>
                <texture texture="photo" />

    I just want to be sure: The first example is wrong and the second one is correct, yes?

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: How to correctly reference a texture image

    Yes.

    What document has the wrong (first) description?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •