Results 1 to 5 of 5

Thread: input_set without set

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    3

    input_set without set

    I created a simple blender scene, containing a textured sphere only.
    Upon exporting to Collada 1.4, the resulting file contains this tag:

    Code :
    <instance_material symbol="Material_001" target="#Material_001"> 
       <bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/> 
    </instance_material>

    I can't figure out this reference to input_set="1". There's no "set" defined in the entire document, and no texcoords whatsoever. So what could it mean?
    Am I doing something wrong, or is it a bug in the Blender exporter?

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    input_set is used to differentiate between multiple sets of texture coordinates in the mesh. It's explained in the release notes.

    It's useless to bind texture coordinates with <bind_vertex_input> if you don't have any textures, but it doesn't hurt anything.

    Steve

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    3
    sthomas,

    that was quick, thank you

    However, there is exactly one texture in the scene, applied on the sphere... so my question now is: how should this binding be interpreted, since the .DAE file declares the material and effect (plus the texture filename, of course), but it doesn't declare any texcoords (only contains vertexes and normals).

    I'm including the file below, with some data stripped off:

    Code :
    <?xml version="1.0" encoding="utf-8"?>
    <COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema">
    	<asset>
    		<contributor>
    			<author>Illusoft Collada 1.4.0 plugin for Blender - http://colladablender.illusoft.com</author>
    			<authoring_tool>Blender v:245 - Illusoft Collada Exporter v:0.3.159</authoring_tool>
    			<comments></comments>
    			<copyright></copyright>
    			<source_data>file://untitled.blend</source_data>
    		</contributor>
    		<created>2008-03-21T22:43:51.481836</created>
    		<modified>2008-03-21T22:43:51.481895</modified>
    		<unit meter="0.01" name="centimeter"/>
    		<up_axis>Z_UP</up_axis>
    	</asset>
    	<library_cameras>
    		<camera id="Camera-Camera" name="Camera-Camera">
    			<optics>
    				<technique_common>
    					<perspective>
    						<yfov>49.13434</yfov>
    						<znear>0.1</znear>
    						<zfar>100.0</zfar>
    					</perspective>
    				</technique_common>
    			</optics>
    		</camera>
    	</library_cameras>
    	<library_effects>
    		<effect id="Material_001-fx" name="Material_001-fx">
    			<profile_COMMON>
    				<newparam sid="pedra_png_001">
    					<surface type="2D">
    						<init_from>pedra_png_001-img</init_from>
    						<format>A8R8G8B8</format>
    					</surface>
    				</newparam>
    				<newparam sid="pedra_png_001-sampler">
    					<sampler2D>
    						<source>pedra_png_001</source>
    						<minfilter>LINEAR_MIPMAP_LINEAR</minfilter>
    						<maxfilter>LINEAR</maxfilter>
    					</sampler2D>
    				</newparam>
    				<technique sid="blender">
    					<phong>
    						<emission>
    							<color>0.00000 0.00000 0.00000 1</color>
    						</emission>
    						<ambient>
    							<color>0.40000 0.40000 0.40000 1</color>
    						</ambient>
    						<diffuse>
    							<texture texcoord="CHANNEL1" texture="pedra_png_001-sampler"/>
    						</diffuse>
    						<specular>
    							<color>0.50000 0.50000 0.50000 1</color>
    						</specular>
    						<shininess>
    							<float>12.5</float>
    						</shininess>
    						<reflective>
    							<color>1.00000 1.00000 1.00000 1</color>
    						</reflective>
    						<reflectivity>
    							<float>0.0</float>
    						</reflectivity>
    						<transparent>
    							<color>1 1 1 1</color>
    						</transparent>
    						<transparency>
    							<float>0.0</float>
    						</transparency>
    					</phong>
    				</technique>
    			</profile_COMMON>
    		</effect>
    	</library_effects>
    	<library_images>
    		<image id="pedra_png_001-img" name="pedra_png_001-img">
    			<init_from>pedra.png</init_from>
    		</image>
    	</library_images>
    	<library_lights>
    		<light id="Spot" name="Spot">
    			<technique_common>
    				<point>
    					<color>1.00000 1.00000 1.00000</color>
    					<constant_attenuation>1.0</constant_attenuation>
    					<linear_attenuation>0.0</linear_attenuation>
    					<quadratic_attenuation>0.0</quadratic_attenuation>
    				</point>
    			</technique_common>
    		</light>
    	</library_lights>
    	<library_materials>
    		<material id="Material_001" name="Material_001">
    			<instance_effect url="#Material_001-fx"/>
    		</material>
    	</library_materials>
    	<library_geometries>
    		<geometry id="Sphere_001" name="Sphere_001">
    			<mesh>
    				<source id="Sphere_001-Position">
    					<float_array count="2982" id="Sphere_001-Position-array">0.00000 0.00000 1.00000 0.09802 0.00000 0.99518 0.77301 0.00000 0.63439 0.09613 0.01912 -0.99518 0.19134 0.03806 -0.98079 0.28471 0.05663 -0.95694 0.37533 0.07466 -0.92388 
    (...)
    -0.99518</float_array>
    					<technique_common>
    						<accessor count="994" source="#Sphere_001-Position-array" stride="3">
    							<param type="float" name="X"></param>
    							<param type="float" name="Y"></param>
    							<param type="float" name="Z"></param>
    						</accessor>
    					</technique_common>
    				</source>
    				<source id="Sphere_001-Normals">
    					<float_array count="17856" id="Sphere_001-Normals-array">0.00000 0.00000 -1.00000 0.09610 0.01910 -0.99518 0.09799 0.00000 -0.99518 0.09799 0.00000 -0.99518 0.09610 0.01910 -0.99518 0.19132 0.03806 -0.98077 0.19132 0.03806 -0.98077 0.09610 -0.01910 -0.99518 0.09799 0.00000 -0.99518 0.19507 
    (...)
    0.00000 -0.98077 0.19507 0.00000 -0.98077 0.19132 -0.03806 -0.98077 0.09610 -0.01910 -0.99518 0.00000 0.00000 -1.00000 0.09799 0.00000 -0.99518 0.09610 -0.01910 -0.99518</float_array>
    					<technique_common>
    						<accessor count="5952" source="#Sphere_001-Normals-array" stride="3">
    							<param type="float" name="X"></param>
    							<param type="float" name="Y"></param>
    							<param type="float" name="Z"></param>
    						</accessor>
    					</technique_common>
    				</source>
    				<vertices id="Sphere_001-Vertex">
    					<input semantic="POSITION" source="#Sphere_001-Position"/>
    				</vertices>
    				<triangles count="1984" material="Material_001">
    					<input offset="0" semantic="VERTEX" source="#Sphere_001-Vertex"/>
    					<input offset="1" semantic="NORMAL" source="#Sphere_001-Normals"/>
     
     
    127 0 3 1 993 2 993 3 3 4 4 5 4 6 992 7 993 8 992 9 4 10 5 11 5 12 991 13 992 14 991 15 5 16 6 17 6 18 990 19 991 20 990 21 6 22 7 23 7 24 989 25 990 26 989 27 7 28 8 29 8 30 988 31 
    (...)
    936 5931 991 5932 990 5933 990 5934 937 5935 936 5936 935 5937 992 5938 991 5939 991 5940 936 5941 935 5942 934 5943 993 5944 992 5945 992 5946 935 5947 934 5948 127 5949 993 5950 934 5951</p>
    				</triangles>
    			</mesh>
    		</geometry>
    	</library_geometries>
    	<library_visual_scenes>
    		<visual_scene id="Scene" name="Scene">
    			<node layer="L1" id="Sphere" name="Sphere">
    				<translate sid="translate">-0.00033 0.04403 0.01769</translate>
    				<rotate sid="rotateZ">0 0 1 -89.84046</rotate>
    				<rotate sid="rotateY">0 1 0 -1.77310</rotate>
    				<rotate sid="rotateX">1 0 0 86.15539</rotate>
    				<scale sid="scale">1.00000 1.00000 1.00000</scale>
    				<instance_geometry url="#Sphere_001">
    					<bind_material>
    						<technique_common>
    							<instance_material symbol="Material_001" target="#Material_001">
    								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
    							</instance_material>
    						</technique_common>
    					</bind_material>
    				</instance_geometry>
    			</node>
    			<node layer="L1" id="Lamp" name="Lamp">
    				<translate sid="translate">4.07625 1.00545 5.90386</translate>
    				<rotate sid="rotateZ">0 0 1 106.93632</rotate>
    				<rotate sid="rotateY">0 1 0 3.16371</rotate>
    				<rotate sid="rotateX">1 0 0 37.26105</rotate>
    				<scale sid="scale">1.00000 1.00000 1.00000</scale>
    				<instance_light url="#Spot"/>
    			</node>
    			<node layer="L1" id="Camera" name="Camera">
    				<translate sid="translate">7.48113 -6.50764 5.34367</translate>
    				<rotate sid="rotateZ">0 0 1 46.69194</rotate>
    				<rotate sid="rotateY">0 1 0 0.61977</rotate>
    				<rotate sid="rotateX">1 0 0 63.55930</rotate>
    				<scale sid="scale">1.00000 1.00000 1.00000</scale>
    				<instance_camera url="#Camera-Camera"/>
    			</node>
    		</visual_scene>
    	</library_visual_scenes>
    	<scene>
    		<instance_physics_scene url="#Scene-Physics"/>
    		<instance_visual_scene url="#Scene"/>
    	</scene>
    </COLLADA>

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    I'm a Blender newb but I did some testing on their Collada support a year or so ago and I remember getting texturing to work, although it was a little unintuitive. In the exporter there's a 'Use UV Image' option. I'm pretty sure that should be checked. Also I think only 'image' texture types are supported (using Blender's terminology).

  5. #5
    Junior Member
    Join Date
    Mar 2008
    Posts
    3
    Exactly. But as it turns out, even though the sphere was rendering correctly, one must still manually define the UV map before exporting to COLLADA...

    Without the manually defined UV map, the exporter just ignores the fact that a material is applied to the object, and skips the texcoords altogether.

    It works now. Thanks for the tips!

Posting Permissions

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