Detail textures
by Rob Evans · in Torque Game Engine Advanced · 07/19/2007 (3:37 am) · 23 replies
I'm adding a detail texture to my material that will be applied to a sphere (planet in game) but the detail texture won't show up. I've tried a number of different approaches. The console doesn't show any errors when loading the material file and the bump and specular are working.
Here is my material:
Any ideas?
Here is my material:
new Material(PlanetBump)
{
baseTex[0] = "earthMap4";
bumpTex[0] = "earthMap4_bump";
detailTex[0] = "detail1";
pixelSpecular[0] = false;
specular[0] = "0.1 0.1 0.1 1.0";
specularPower[0] = 20.0;
};Any ideas?
#2
07/19/2007 (7:10 am)
Indeed, all of those things are correct. I just don't get it! Does it only work on terrain? That's the only time I've ever seen a detail texture apply.
#3
07/19/2007 (8:45 am)
Make sure your image has a lot of white and dark values in it. Contrast works best for detail textures, while stuff that blends between the two doesnt really show up very well at all.
#4
07/19/2007 (10:45 am)
I'm using the detail texture that came with TSE for the terrain. I know that it works for that! Has anyone EVER mapped a detail texture onto anything other than terrain?
#5
07/19/2007 (11:13 am)
I tried it myself and couldn't get it to work as I would expect it to, but it did sometimes make the material appear darker. I tried a bunch of things -- simple detail texture with a big dot, putting detail in stage 2, using baseTex with and without alpha and nothing looked right, There also seems to be a missing piece of information here, which is some kind of parameter to control the density of the tiles. It may be possible that the density is so fine or so coarse, that you can't see the texture in the results.
#6
07/21/2007 (4:08 pm)
Can you even use the detail1 texture as a TGEA texture? Wouldn't an uncompressed normal be better?
#7
07/22/2007 (3:37 am)
What's an uncompressed normal? I've created normal maps using the photoshop plugin from nvidia... how to I use that to make an uncompressed one?
#8
07/22/2007 (3:50 am)
I tend to agree with Eric, why are you wasting time with detail maps when TGEA has bump mapping? If you really need a detail texture, using Photoshop to combine your diffuse and detail texture will provide you with the exact same results as the old detail mapping code in TGE.
#9
Well I wanted an effect similar to the TGE terrain so that as you move closer to it, you get the detail texture kicking in and making the terrain less pixelated (or rather the illusion of that).
Can that be done with bump maps?
07/22/2007 (3:52 am)
I see...Well I wanted an effect similar to the TGE terrain so that as you move closer to it, you get the detail texture kicking in and making the terrain less pixelated (or rather the illusion of that).
Can that be done with bump maps?
#10
I guess you'd have to code that functionality in for yourself.
07/22/2007 (4:01 am)
I've seen the effect you're talking about - IIRC that's an Atlas terrain feature and not a generic feature of detail maps. I guess you'd have to code that functionality in for yourself.
#11
07/22/2007 (4:05 am)
Hmm... fair enough. Garagegames... this might be a good feature to add into all objects, not just the terrain!
#12
I don't have a good suggestion for your idea. Sounds neat, though.
07/22/2007 (4:22 am)
I just meant saving it in an uncompressed format, like .PNG or some .DDS types. Just like compression messes up regular digital pics, it does the same to normals.I don't have a good suggestion for your idea. Sounds neat, though.
#13
07/22/2007 (4:23 am)
Oh I see LOL... that's me being dumb! Yeah I never save as anything except png nowadays anyway :o)
#14
Turns out that for some reason, the engine needed me to specify where the file was, and its extension. Here is my new material:
07/23/2007 (8:02 am)
OK, I've managed to solve this one!Turns out that for some reason, the engine needed me to specify where the file was, and its extension. Here is my new material:
new Material(PlanetBump)
{
mapTo = earthMap4;
baseTex[0] = "earthMap4";
bumpTex[0] = "earthMap4_bump";
detailTex[0] = "~/data/shapes/planet2/planetDetail.png";
vertexSpecular[0] = false;
pixelSpecular[0] = true;
specular[0] = "0.2 0.2 0.2 1";
specularPower[0] = 3.0;
};
#15
This may turn out to be obvious in hindsight for you, but that's the purpose and intent of Materials (and more specifically, CustomMaterials)--they define textures and values for allowing the Procedural Shader Generation system to work.
Just re-enforcing, since your context "for some reason" implies that you may not understand why you had to add the texture in. Sounds weird, but the reason you had to add in the texture file name is because this is the way you tell the PSG what texture to use.
07/23/2007 (8:39 am)
Quote:
Turns out that for some reason, the engine needed me to specify where the file was, and its extension.
This may turn out to be obvious in hindsight for you, but that's the purpose and intent of Materials (and more specifically, CustomMaterials)--they define textures and values for allowing the Procedural Shader Generation system to work.
Just re-enforcing, since your context "for some reason" implies that you may not understand why you had to add the texture in. Sounds weird, but the reason you had to add in the texture file name is because this is the way you tell the PSG what texture to use.
#16
07/23/2007 (8:48 am)
Perhaps the confusion stems from the fact that textures assigned to a mesh within a DCC program need no path specified, they just have to reside within the same folder as the DTS. The detail texture is a little different as the DTS does not contain any material information regarding this texture and therefore a full path is required.
#17
Edit: It looks like Tim has a good explanation.
Another Edit: Now I'm not so sure... does the DTS contain references to the bumpmap?
07/23/2007 (8:52 am)
@ Stephen -- What you're saying doesn't really make sense. Rob is saying "for some reason" because the other fields don't require a path or extension, "for some reason" detailTex does. Sounds strange to me too, so I'll see if I can find out the real reasons.Edit: It looks like Tim has a good explanation.
Another Edit: Now I'm not so sure... does the DTS contain references to the bumpmap?
#18
Thanks for following up both of you!
07/23/2007 (8:59 am)
Ahh, given Tim and Jeff's follow up posts I see the difference, and yes, I think Tim's point is the correct one. The path to the texture has to exist somewhere--in textures within a dts shape, the "baseTex" is actually (for non-custom materials anyway) built up due to known file location conventions, whereas the detail texture does not have those conventions.Thanks for following up both of you!
#19
However, Stephen, whilst I've got you here, I don't suppose you could take a look at this question regarding lighting could you? I still haven't been able to solve it:
http://www.garagegames.com/mg/forums/result.thread.php?qt=64894
Have a look at the middle of the planet... there are jagged triangles where the specular lighting is affecting the dts object. I thought it was a bit weird considering the specular is supposed to work on pixels rather than vertices!
07/23/2007 (9:22 am)
Indeed, my point was that I had to supply a path for the detail map, but not for the base or bumps! Either way, it all works now and that's all that matters to me :o)However, Stephen, whilst I've got you here, I don't suppose you could take a look at this question regarding lighting could you? I still haven't been able to solve it:
http://www.garagegames.com/mg/forums/result.thread.php?qt=64894
Have a look at the middle of the planet... there are jagged triangles where the specular lighting is affecting the dts object. I thought it was a bit weird considering the specular is supposed to work on pixels rather than vertices!
#20
07/23/2007 (9:26 am)
@ Rob -- I've been looking into this and I'm not so sure it was the path and extension that made it work. Is there anything else you changed at the same time?
Torque Owner Deepeyed
Neil