Horde3D
http://horde3d.org/forums/

Textures not showing
http://horde3d.org/forums/viewtopic.php?f=2&t=2242
Page 1 of 1

Author:  72deluxe [ 28.01.2014, 14:09 ]
Post subject:  Textures not showing

Hello

I am creating textures in JPG, PNG and TGA formats and applying them to a simple rectangular box that I have exported from Blender 2.69 using a material. But when using the forward or deferred pipeline, I am not seeing ANY texture detail on the item! Oddly, if I add a sphere to the scene (such as the Knight is standing on in the Knight sample app), the textures appear perfectly fine for that. I get the general colour of the texture on my object but not the texture itself. Any pointers?

Here is my light:
Code:
H3DRes FLightMatRes = h3dAddResource( H3DResTypes::Material, "materials/light.material.xml", 0 );
H3DNode light = h3dAddLightNode( H3DRootNode, "Light1", FLightMatRes, "LIGHTING", "SHADOWMAP" );
h3dSetNodeTransform( light, 300, 1000, -40,    -45, 0, 0,    1, 1, 1 );
h3dSetNodeParamF( light, H3DLight::RadiusF, 0, 200 );
h3dSetNodeParamF( light, H3DLight::FovF, 0, 90 );
h3dSetNodeParamI( light, H3DLight::ShadowMapCountI, 3 );
h3dSetNodeParamF( light, H3DLight::ShadowSplitLambdaF, 0, 0.9f );
h3dSetNodeParamF( light, H3DLight::ShadowMapBiasF, 0, 0.001f );
h3dSetNodeParamF( light, H3DLight::ColorF3, 0, 0.9f );
h3dSetNodeParamF( light, H3DLight::ColorF3, 1, 0.9f );
h3dSetNodeParamF( light, H3DLight::ColorF3, 2, 0.9f );


Here is my "concretepanel" scene XML:
Code:
<Model name="concretepanel" geometry="models/concretepanel/concretepanel.geo">
   <Mesh name="Cube" material="models/concretepanel/concretematerial.material.xml" rx="-0" ry="0" rz="-180" sx="-2.94385" sy="4.97642" sz="0.164309" batchStart="0" batchCount="36" vertRStart="0" vertREnd="23" />
</Model>


Here is my material for the panel:
Code:
<Material>
   <Shader source="shaders/model.shader" />
   <ShaderFlag name="_F01_Skinning" />
   <ShaderFlag name="_F02_NormalMapping"/>
   <Sampler name="albedoMap" map="models/concretepanel/water0hk.jpg" />
</Material>


That water JPG is found at http://www.interlopers.net/images/hl2tutorials/water_textures/water0hk.jpg

I have attached the concrete panel GEO and source DAE (renamed with .txt extensions). Do you see any problems? I am completely stumped!

Attachments:
concretepanel.geo.txt [1.36 KiB]
Downloaded 903 times
concretepanel.dae.txt [4.23 KiB]
Downloaded 914 times

Author:  72deluxe [ 28.01.2014, 16:31 ]
Post subject:  Re: Textures not showing

Hello

Is this related to UV mapping by any chance? I found a post here on the forum that seems to indicate the same problem http://horde3d.org/forums/viewtopic.php?f=11&t=419 but I would appreciate some pointers before I carry on.

Any recommended reading anyone can point me to ? Or any help clarifying?

Thanks
Rich

Author:  mikel [ 29.01.2014, 03:43 ]
Post subject:  Re: Textures not showing

Hi.
Checked your .dae file, there isnt any info about texture or TEXCOORDs.

But try this:
start blender, drag'n'drop your texture to the default cube (it will be textured),
File->Export->Collada .dae, check "Include UV Textures".

And when creating new object, create new material as well, then drag'n'drop texture on it (if you dont create material/use existing material, then .dae file doenst have texture info).

Your material file is wrong. You are setting skininng and normalmap flags but your panel doesnt have bones and material doesnt have
<Sampler name="normalMap" map="textures/someNormalMap.png" allowCompression="false" />
but when converting textured .dae model, it creates working material file too.

Author:  72deluxe [ 29.01.2014, 10:39 ]
Post subject:  Re: Textures not showing

Hello

Thanks very much for the reply. I followed a tutorial on UV mapping in Blender (http://www.youtube.com/watch?v=X3aLlpSAaH4 and that worked! I haven't used Blender in anger for years - I think I bought the book on the 2.3 series perhaps and before that had used TrueSpace (anyone remember that????) but not in anger so there is a steep curve ahead!

Many thanks for checking my file and looking over my materials etc., much appreciated

Thanks again
Rich

Author:  72deluxe [ 29.01.2014, 10:40 ]
Post subject:  Re: Textures not showing

Out of interest, how did you check the .dae file? I am using a Mac and there is a DAE inspector in Xcode but what do you use?

Author:  mikel [ 29.01.2014, 14:31 ]
Post subject:  Re: Textures not showing

72deluxe wrote:
Out of interest, how did you check the .dae file? I am using a Mac and there is a DAE inspector in Xcode but what do you use?


I just opened it in text editor, searched jpg, png and texcoord :)

And imported it in Blender to check what it is.

Author:  72deluxe [ 29.01.2014, 15:03 ]
Post subject:  Re: Textures not showing

Haha OK. I should try looking at the DAE as it is a text file after all!

One problem I am having is that my texture appears reddish no matter how bright I make it (modifying the PNG) or what colour lights I apply. I cannot see anything obvious in the model shader, other than the [[FS_AMBIENT]] section at the end.

What is likely to be the cause of the annoying reddishness?

Author:  mikel [ 29.01.2014, 16:00 ]
Post subject:  Re: Textures not showing

72deluxe wrote:
What is likely to be the cause of the annoying reddishness?


It is because of Content/textures/ambientMap.dds

You can delete it, or delete
<Sampler name="ambientMap" map="textures/ambientMap.dds" />
line in globalSettings.material.xml.

Then you can modify model.shader to not use ambientMap.
Code:
   //gl_FragColor.rgb = albedo.rgb * textureCube( ambientMap, normal ).rgb; //orig line
   gl_FragColor.rgb = albedo.rgb * vec3(0.2, 0.2, 0.2);

Author:  72deluxe [ 29.01.2014, 18:29 ]
Post subject:  Re: Textures not showing

Thanks for the information. That was indeed it. I have used another brighter DDS, although a white one makes everything far too bright. Thanks again.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/