Yep, j'ai remarqué ça, du coup j'arrive à agir sur les mesh indépendamment des objets. Mais si j'ajoute la balise attach_material le mesh disparait, j'ai essayé un paquet d'option en regardant sur différents samples.
Voici le code actuel, c'est basé sur un des samples :
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!--
==============================================================================
FILE: HyperGraph Tutorial 48.
AUTHOR: JeGX
DATE: 05.01.2005
PURPOSE: Shows a cartoon shader.
This file is part of Hyperion Demo-System.
For the latest info, see http://www.oZone3D.net
Copyright (C)2004 Jerome "JeGX" GUINOT
==============================================================================
-->
<hyperion version="1.0">
<scene name="hypergraph_48" display_fps="TRUE" show_ref_grid="TRUE" >
<window_size width="1024" height="768" />
<background_color r="0.2" g="0.4" b="0.6" />
<ref_grid_color r="0.9" g="0.9" b="0.9" />
<check_hardware_caps oglsl="TRUE"
error_message="Sorry, this demo requires OpenGL Shading Language support. Demo startup failed. Bye..." />
</scene>
<camera name="my_camera" navigation_mode="FLY" fov="50.0" >
<position x="0.0" y="50.0" z="150.0" />
</camera>
<light name="my_light" type="OMNI" render="FALSE" >
<position x="0.0" y="100.0" z="100.0" />
<diffuse r="1.0" g="1.0" b="1.0" a="1.0" />
</light>
<!--
====== TEXTURE ================================================================
-->
<!--
Here is the effect: by specifying SPHERE_ENV_MAP, you
tell to the Hyperion 3D engine how calculate texture coordinates
to simulate environment reflection.
-->
<texture name="env2" filename="03_textures/Oj_64.png" addressing_mode="MIRROR"
gen_coord_mode="SPHERE_ENV_MAP" />
<material name="mat_torus" shader_program_name="toonShader" >
<diffuse_reflection_factor r="0.8" g="0.75" b="0.35" a="1.0" />
<specular_reflection_factor r="0.95" g="0.93" b="0.7" a="1.0" />
</material>
<material name="mat01" >
<diffuse_reflection_factor r="0.5" g="0.35" b="0.35" a="1.0" />
<specular_reflection_factor r="0.05" g="0.03" b="0.92" a="1.0" />
</material>
====== MODEL =================================================================
-->
<model name="spheres" filename="02_models/spheres.obj" lighting="TRUE" texturing="TRUE" render="TRUE" >
<position x="0.0" y="0.0" z="0.0" />
<scale x="2.0" y="2.0" z="2.0" />
</model>
<!--
====== MESH =================================================================
-->
<mesh name="sphereA" parent_name="spheres" shape_type="MODEL_SUB_MESH" texturing="TRUE" lighting="FALSE" polygon_mode="SOLID" auto_spin="TRUE" >
<optimize method="VERTICES" />
<spin_values x="10.0" y="0.0" z="0.0" />
<vertices_color r="0.10" g="1.0" b="1.0" a="1.0" />
</mesh>
<mesh name="sphereB" parent_name="spheres" shape_type="MODEL_SUB_MESH" texturing="TRUE" lighting="TRUE" polygon_mode="SOLID" auto_spin="TRUE">
<optimize method="VERTICES" />
<attach_material name="mat01" />
<spin_values x="0.0" y="10.0" z="0.0" />
</mesh>
<mesh name="sphereC" parent_name="spheres" shape_type="MODEL_SUB_MESH" texturing="TRUE" lighting="TRUE" polygon_mode="SOLID" auto_spin="TRUE">
<optimize method="VERTICES" />
<spin_values x="0.0" y="0.0" z="10.0" />
</mesh>
<mesh name="my_torus" render="TRUE" shape_type="TORUS" lighting="TRUE" texturing="TRUE"
auto_spin="TRUE" polygon_mode="SOLID" >
<position x="0.0" y="0.0" z="0.0" />
<torus radius="50.0" vertex_density="100" section_radius="1.0" />
<optimize method="VERTICES" />
<attach_material name="mat01" />
<vertices_color r="1.0" g="1.0" b="1.0" a="1.0" />
<spin_values x="10.0" y="0.0" z="20.0" />
</mesh>
Ici la sphere A est bien affichée, et sa couleur correspond à ce qui est indiqué dans la balise vertices_color. La sphere B a disparue. La sphere C est affichée avec la couleur par défaut. Le tore qui a aussi le "mat01", est visible et sa couleur correspond bien au mat01 (donc le souci ne vient pas, a priori, du matériau en lui même). Bref a part la balise attach_material je ne vois rien qui influe sur le rendu, à moins que je ne doivent réinitialiser certains paramètres des matériaux avant d'en affecter un autre ?