Horde3D

Next-Generation Graphics Engine
It is currently 25.10.2021, 15:46

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Textures not showing
PostPosted: 28.01.2014, 14:09 
Offline

Joined: 01.11.2013, 11:39
Posts: 14
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 575 times
concretepanel.dae.txt [4.23 KiB]
Downloaded 609 times
Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 28.01.2014, 16:31 
Offline

Joined: 01.11.2013, 11:39
Posts: 14
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 03:43 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 10:39 
Offline

Joined: 01.11.2013, 11:39
Posts: 14
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 10:40 
Offline

Joined: 01.11.2013, 11:39
Posts: 14
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 14:31 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 15:03 
Offline

Joined: 01.11.2013, 11:39
Posts: 14
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 16:00 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
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);


Top
 Profile  
Reply with quote  
 Post subject: Re: Textures not showing
PostPosted: 29.01.2014, 18:29 
Offline

Joined: 01.11.2013, 11:39
Posts: 14
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group