I have my terrain made fairly low poly hoping that the smoothing would be enough to discuise the fact since my game is primarily a flying one.
With fixed function materials the smoothing works as expected, but when I use Shaders many of the triangles show as flat shaded. See pic:
My shader does use per pixel lighting? I guess this may be why, is there another way to get the smoothing more like the fixed function material?
I thought I'd ask as the usual smoothing tricks I use with fixed function snoothing angles don't seem to apply when using shaders.
thought I'd look at the model in the max viewport with the shaderFX material applied and see how the shader looks in max before converting to ogre: It shows none of the flat shading problems that ofusion does, Is there still some kind of a normal smoothing problem?
http://www.kineticrealities.com/shaderfxsmoothing.jpg
It doesn't have any of the smoothing problems that appear in ofusion and ogre
I noticed there were a bunch of normal smoothing problems on another thread that don't seem to have been addressed.
http://www.ogre3d.org/phpBB2addons/view ... =smoothing
Lioric
19-07-2007 00:47:33
If the normals are correct in fixed function then its not a normals issue (as the same normals are used in the shaders, similar to the vertex points or colors, the same data stream is sent to the gpu)
It mostly seem to be a shader issue, probably a variation in the compilation, have you tested with OpenGL and D3D9 (cg)?
Could you apply the same texture to the fixed function material, as the normals doesnt seem to be used in the shaderfx image
jwatte
19-07-2007 18:07:52
Do you have a proper tangent space?
I'm an artist really, not able to do an awful lot with shader code.
It seems to be happening mostly on large polygons, The same shader on more dense meshes doesn't have the same problem.
Lioric
20-07-2007 15:35:52
It means if you have the "Generate Tangents" enabled for your objects and if you are using the correct TEXCOORD channel in your shader where the tangents are created
we couldn't find anything wrong with the shader. I did a polymesh smooth which subdivided all the large low poly terrain and the smoothing works fine. It's only really large triangles that have the problem.
Need to figure out how static geometry groups work now, everytime I try making the terrain a static geometry group the terrain disappears. I'm not sure how the range and region settings are supposed to work at the moment.
Here's a pic of the terrain after the low poly terrain is subdivided.
http://www.tysoes.com/des1.jpg
Lioric
24-07-2007 02:41:37
Just to mention that it is looking good
hmm, thanks lioric. I"m still having problems with the smoothing though. Now the problem has become more pronounced since I'm welding parts of the terrain together and trying to blend between two textures on the canyon walls.
http://kineticrealities.com/smoothing3.jpg
welding the vertices and using the same smoothing groups makes no difference, still lights as though there are two seperate smoothing groups. you can see it a little higher up on the cliff ledge as well as at the base where the floor meets the cliffs.
Jeremy who helped convert the shader to ogre thinks the tex coord streams are correct and tried other combinations, but didn't manage to fix it.
Do you think the Auto Parameters bug that was fixed in 1.4.3 could be it? were still using 1.4.2
Bug fix for auto params light_direction_view_space_array and light_direction_object_space_array
Hi Lioric, I got a PM from another ogre user (Disanti) regarding my problem, They suggested that I try another exporter. So I uninstalled ofusion and tried Lexiporter to see how the smoothing turned out with a basic shader there.
It seems there is a problem with Ofusions meshes and smoothing when using shader materials. You can see the two scenes below.
LEXIPORTER
OFUSION
I'll post a support ticket shortly with sample mesh file in XML and binary format. It's a pretty serious problem for anyone that uses shaders, Disanti uses the CE version but the problem is also in both CE and PRO.
Here's the other thread that shows what proved to be the same problem in the CE version.
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4872
http://www.amnesiasoft.com/uploads/2756 ... ngents.jpg
Distani discovered that other max exporters and blender exported the above Ofusion tunnel mesh perfectly.
Lioric
03-08-2007 04:19:39
I will review this issue immediately