Another interesting thing, no mather how many treeâs i add, the lighting of one is always âfrogottenâ (depending on the viewdirection the forgotten one is selected)
@mifth said: @zzuegg , you will need to switch tangentBinormalGenerator on for your models.
[java]TangentBinormalGenerator.generate(Spatial/Node/Geometry);
[/java]
@zzuegg Are your trees normal mapped?
If they are mifth is right you should generate tangents
If there are not there is no point in generating tangents.
Arent normals distinct to a normal map though? I always thought a normal map was a high poly render of a model used to produce a texture for a lower poly render of that model.
Idk, I was just thinking how does the shader know about the normal of the triangle else? But I think youâre right, the issues only start when a normal maps actually being usedâŚ
Wouldnt normals be automatically generated based on which way the triangle was facing? I mean, if they didnt have normals, I dont think they would be lit at allâŚ
If you want to use lighting⌠your vertexes will need normals. No exceptions.
If you want to use normal maps or bump maps, you will also need tangents⌠no exceptions.
So, if you donât have normal maps then you just need normals on your vertexes. These canât be determined correctly automatically because a) the shader doesnât know anything about triangles, b) it wouldnât know what should be smooth and what shouldnât, etc. anyway.
Thank you for the replyâs. The code above will affect only the terrain because all the objects are loaded and attached at runtime trough custom controls.
Once i find some free time i will make some trees with blender to check if there is something wrong with the generated models.
Unfortunately i have a new different issue. (I am really sorry to bother you with all my issues)
I have implemented another control which replaces the 3d model with a simple plane (which is following the camera and is texturized with a picture of the same tree as the model). Currently its only a very simple kind of LOD management, but i have already ideas how to extend it).
As you can see on the screenshots on the border of the visible part of the texture a greenish border gets drawn. How can i get rid of that?
I am using the Lighting material:
[java]Material My Material : Common/MatDefs/Light/Lighting.j3md {
@pspeed said:
And note: if this does fix it then you _are_ using normal maps and you just don't know it.
Tangents are 100% ignored without normal maps and bump maps as the sole purpose is to define "tangent space" for those textures.
If i have made the materials i use myself how can normal maps be used? Can the be stored in the model?
(If the objects are cloned, do i need to call TangentBinormalGenerator.generate(spatial); on every clone or only on the original?)
@zzuegg said:
If i have made the materials i use myself how can normal maps be used? Can the be stored in the model?
They would be part of the material. The material could be stored on the model, I suppose.
My point was that it keeps getting suggested to generate tangents and if you don't have normal maps then it's not at all even slightly relevant. And if it _does_ fix your issues then something else is going on... because tangents only matter if you have normal or bump maps. If you don't then tangents aren't used... a little dance and a pat on your head would be as effective a solution as calling TangentBinormalGenerator.
@zzuegg said:
(If the objects are cloned, do i need to call TangentBinormalGenerator.generate(spatial); on every clone or only on the original?)
@zzuegg said:
As you can see on the screenshots on the border of the visible part of the texture a greenish border gets drawn. How can i get rid of that?
You might be able to mess with some settings on the materials additional render state.
If you use AA then you can try the "alpha to coverage". Otherwise, try playing with the alpha falloff and threshold.
Usually these borders are caused by partially transparent pixels being rendered and filling the Z-buffer before the parts of the scene behind it are drawn. Though in this case that also implies that your ground is in the transparent bucket with the trees. You'll still need to deal with the border or your edges will render through other trees, too.