How to use textures in Indigo?

Discuss stuff not about Indigo.
Post Reply
9 posts • Page 1 of 1
User avatar
arneoog
Indigo 100
Posts: 504
Joined: Sun Jun 25, 2006 2:19 am
Contact:

How to use textures in Indigo?

Post by arneoog » Wed Jun 28, 2006 12:18 am

How do I get Indigo to use textures? :?
What should be written in here?

Code: Select all

<material>
	<name>Material</name>
	<diffuse>
		<colour>0.5 0.5 0.5</colour>
	</diffuse>
</material>

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Wed Jun 28, 2006 1:24 am

Code: Select all

<material>
		<name>textest</name>
		
		<diffuse>
			<colour>0.8 0.8 0.8</colour>
			
			<albedo_texture>
				<uv_set>albedo</uv_set>
				<path>indigo2.jpg</path>
				<gain>1.0</gain>
				<exponent>1.0</exponent>
			</albedo_texture>
		</diffuse>
	</material>

User avatar
arneoog
Indigo 100
Posts: 504
Joined: Sun Jun 25, 2006 2:19 am
Contact:

Post by arneoog » Wed Jun 28, 2006 1:38 am

Thank you :D
What does albedo mean?

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Wed Jun 28, 2006 1:41 am

It's the ratio of light reflected

User avatar
arneoog
Indigo 100
Posts: 504
Joined: Sun Jun 25, 2006 2:19 am
Contact:

Post by arneoog » Wed Jun 28, 2006 1:47 am

okay...
When I try using the texture I get tis error:
SceneLoaderExcept: TextureUnitExcept: The texture 'testscenes\textures\bad_wood_floor.jpg' could not be bound to uv set with name 'albedo', because that uv set was not exposed in an expose_uv_set element.
Erhm... :?

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Wed Jun 28, 2006 2:03 am

The mest needs to export a uv set called 'albedo', eg (note the expose_uv_set with name = albedo near the top)

Code: Select all

<mesh>
		<name>mesh1</name>
	
		<!-- define an 'embedded' nesh instead of loading a .3ds file -->
		<embedded>
			<expose_uv_set>
				<index>0</index>
				<name>albedo</name>
			</expose_uv_set>
				
			<expose_uv_set>
				<index>1</index>
				<name>bump</name>
			</expose_uv_set>
			
			<!--Define some vertices-->
			<!--only uv0's are used here-->
			<vertex pos="-40 -40 1" normal="0 0 1" uv0="0 0" uv1="0 0" uv2="0 0"/>
			<vertex pos="-40 40 1" normal="0 0 1" uv0="0 10" uv1="0 10" uv2="0 1" />
			<vertex pos="40 40 1" normal="0 0 1" uv0="10 10" uv1="10 10" uv2="1 1" />
			<vertex pos="40 -40 1" normal="0 0 1" uv0="10 0" uv1="10 0" uv2="1 0" />
				
			<!--Define a few tris using the above vertices, and the phong material-->		
			<triangle_set>						
				<material_name>mat1</material_name>
				
				<!-- Define the triangles by giving the indices of the vertices they are composed of -->
				<tri>0 1 2</tri>
				<tri>0 2 3</tri>
			</triangle_set>
			
			<vertex pos="2 0 0" normal="-1 0 0" uv0="0 0" />
			<vertex pos="2 0 4" normal="-1 0 0" uv0="0 8" />
			<vertex pos="2 2 4" normal="-1 0 0" uv0="8 8" />
			<vertex pos="2 2 0" normal="-1 0 0" uv0="8 0" />
			
			<triangle_set>
				<material_name>copper</material_name>
				
				<tri>4 5 6</tri>
				<tri>4 6 7</tri>
			</triangle_set>
			
			<vertex pos="-2 0 0" normal="-1 0 0" uv0="0 0" />
			<vertex pos="-2 0 4" normal="-1 0 0" uv0="0 8" />
			<vertex pos="-2 2 4" normal="-1 0 0" uv0="8 8" />
			<vertex pos="-2 2 0" normal="-1 0 0" uv0="8 0" />
			
			<triangle_set>
				<material_name>copper</material_name>
				
				<tri>8 9 10</tri>
				<tri>8 10 11</tri>
			</triangle_set>
		</embedded>
	</mesh>	

User avatar
arneoog
Indigo 100
Posts: 504
Joined: Sun Jun 25, 2006 2:19 am
Contact:

Post by arneoog » Wed Jun 28, 2006 4:53 am

Thanks! Now it's working! 8)

johanjohan
Posts: 43
Joined: Wed Sep 13, 2006 3:33 pm
Location: New Caledonia

Post by johanjohan » Wed Sep 27, 2006 3:56 am

Hi!
I use Blender 2.42 and Indigo_06_test2

but I would like to use texture map..
I dont understand why I look not my texture UV in Indigo's render
thanks

Johan

my xml:

<material>
<name>Default</name>
<diffuse>
<colour>1 1 1</colour>
</diffuse>
</material>
<material>
<name>Material.002</name>
<phong>
<diffuse>0.800 0.800 0.800</diffuse>
<specular>0.500 0.500 0.500</specular>
<fresnel_scale>0.800</fresnel_scale>
<exponent>5110.000</exponent>
<albedo_texture>
<uv_set>uv</uv_set>
<path>ex01.jpg</path>
<gain>1.000000</gain>
<exponent>2.300000</exponent>
</albedo_texture>
<bump_map>
<uv_set>albedo</uv_set>
<path>ex01.jpg</path>
<gain>0.050000</gain>
<exponent>1.000000</exponent>
</bump_map>
</phong>
</material>

<material>
<name>Material</name>
<diffuse>
<colour>0.800 0.800 0.800</colour>
</diffuse>
</material>

<!-- Plane -->
<mesh>
<name>Plane</name>
<embedded>
<expose_uv_set>
<index>0</index>
<name>albedo</name>
</expose_uv_set>
<vertex pos="-53.257542 -12.279655 -0.000000" normal="0.000000 0.000000 1.000000" uv0="0.000000 1.000000"/>

...

<triangle_set>
<material_name>Material</material_name>
<tri>0 1 2</tri>
<tri>2 3 0</tri>
</triangle_set>
</embedded>
</mesh>

<model>
<pos>-0.307043 -3.217489 -1.695625</pos>
<scale>1.0</scale>
<rotation>
<matrix>
1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000
</matrix>
</rotation>
<mesh_name>Plane</mesh_name>
</model>

<!-- Cube -->
<mesh>
<name>Cube.002</name>
<embedded>
<expose_uv_set>
<index>0</index>
<name>albedo</name>
</expose_uv_set>
<vertex pos="1.000000 1.000000 -1.000000" normal="0.000000 0.000000 -1.000000" uv0="0.603818 0.085278"/>

...
<triangle_set>
<material_name>Material.002</material_name>
<tri>0 1 2</tri>
...

</triangle_set>
</embedded>
</mesh>

<model>
<pos>-0.363840 0.172082 0.399063</pos>
<scale>1.0</scale>
<rotation>
<matrix>
1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000
</matrix>
</rotation>
<mesh_name>Cube.002</mesh_name>
</model>

</scene>
Last edited by johanjohan on Wed Sep 27, 2006 11:48 am, edited 1 time in total.

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Wed Sep 27, 2006 5:30 am

@johanjohan
what a copy-paste work si this??? I see fragments of the blender exporter and some manualy pasted code???
Ok, main thing, the "expose_uv_set" name must match "uv_set" in material. In your mesh (Cube.002) you expose the UV set with name "albedo":

Code: Select all

<expose_uv_set> 
<index>0</index> 
<name>albedo</name> 
</expose_uv_set>
But in your material (Material.002) you define a "albedo_texture" that uses the uv_set with name "uv" and a "bump_map" with uv_set "albedo". As uv-set "uv" is not exposed in the mesh you will not see the texture (you have to change this to "albedo" too) but you should see the bump-map:

Code: Select all

<albedo_texture> 
<uv_set>uv</uv_set> 
<path>ex01.jpg</path> 
<gain>1.000000</gain> 
<exponent>2.300000</exponent> 
</albedo_texture> 
<bump_map> 
note: In sample code normaly uv-sets are exposed with the name "albedo", but the Blender exporter exposes uv-set as "uv". You should not mix them... you better use the Blender exported XML as this should work without manual modifications :wink:

regards zuegs

Post Reply
9 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 23 guests