Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Shading looks too flat
Topic Started: Jul 2 2010, 01:39 PM (667 Views)
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Posted Image
Is there anyway to improve shading on this custom mesh?

Each quad is made from four independent vertices wich they don't share with neighbouring quads. Wich is probably the cause of this.
BAP mapping is on.
I have tried SmoothNormals, but only thing it seems to do is screwup texture coordinates. Or I haven't figured out right angle for it.

Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
57E
Jul 2 2010, 01:39 PM
I have tried SmoothNormals, but only thing it seems to do is screwup texture coordinates. Or I haven't figured out right angle for it.
Seems like you have found a bug. SmoothNormals(...) should work. Added this to the list. Please check, whether this also occurs, if you do not use parallax and bump mapping.

As a workaround you can smooth normals manually, because the model manipulation functions allow you to manipulate normal vectors.
Edited by Dr. Best, Jul 2 2010, 02:04 PM.
Offline Profile Quote Post Goto Top
 
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Posted Image
SmoothNormals(45);
parallax and bump mapping ON.

Posted Image
SmoothNormals(45);
parallax and bump mapping OFF.

Value used as the smoothing angle does not seem to have any effect on this.
Edited by 57E, Jul 2 2010, 02:52 PM.

Offline Profile Quote Post Goto Top
 
Satyr
Member Avatar
Captain Gobblecoque
[ *  *  *  *  *  * ]
it sounds like you have to weld them in your modeling program
The feeling of homesickness never goes away when you return to your parents home from years of being away.

same goes with the smell of ash and smoke from the day you set it ablaze.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
@57E
Well, there is probably something going wrong with the vertex component indices. I will debug it, when I find the time to put my hands on U3D 2.1.x. Until then you may try the following workaround: Export the custom mesh as *.u3d file and reimport it immediately. Chances are good that SmoothNormals(...) will work fine on the reimported mesh. If it doesn't I'd appreciate if you could send me the *.u3d file for debugging.

@Satyr
It's a custom mesh, generated at runtime, so that won't be possible.
Offline Profile Quote Post Goto Top
 
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Working on that code...

Exporting meshes goes without errrors, but loading the u3d files with LoadMesh() gives a bunch of "Failed to open file XXXX.u3d for reading" errors, and in the end it loads nothing.

If I try to open them with model viewer...
If I did not use the export resources option, gives "Failed to open file XXXX for reading" errors about every texture file used. Mesh it self appears to be right.
Or if I did export the resources with u3d models. It gives no errors, but every normal mapped material shows up black with some pieces of normal map shimmering white here and there.
Edited by 57E, Jul 6 2010, 11:41 AM.

Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Try exporting it as an non-optimized x-file, which will make every corner smooth.
The Panda exporter has such an option.
Edited by Despellanion, Jul 3 2010, 06:39 PM.
Offline Profile Quote Post Goto Top
 
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Thanks for trying to help, but...
Quote:
 

Posted Image
Is there anyway to improve shading on this custom mesh?

Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
57E
Jul 3 2010, 08:28 PM
Thanks for trying to help, but...
Quote:
 

Posted Image
Is there anyway to improve shading on this custom mesh?
Sorry, I missed that part. What do you mean by custom mesh? A mesh created through code?
Offline Profile Quote Post Goto Top
 
Gandalf20000
Member Avatar
Geek
[ *  *  *  *  *  * ]
Despellanion
Jul 5 2010, 08:39 PM
57E
Jul 3 2010, 08:28 PM
Thanks for trying to help, but...
Quote:
 

Posted Image
Is there anyway to improve shading on this custom mesh?
Sorry, I missed that part. What do you mean by custom mesh? A mesh created through code?
Yes, he probably created it with the mesh manipulation functions.
Offline Profile Quote Post Goto Top
 
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Yep. I have a random level generator wich makes the the custom u3d mesh based on handful of ds_bin arrays.
Posted Image
Currently generated levels look VERY abstract cubism.
As the gerator script (or what ever would be proper name) I currently use for the modelling code testing only randomly splatters randomly sized blocks on the level and deforms them using sine wave.
Spoiler: click to toggle
The basic funcitions for mesh generating, texturing and deforming are finished.
Only problem is slightly messed shading and the fact I have no Idea why the exporting / importing fails.
Edited by 57E, Jul 6 2010, 10:31 AM.

Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
57E
Jul 3 2010, 12:59 PM
Working on that code...

Exporting meshes goes without errrors, but loading the u3d files with LoadMesh() gives a bunch of "Failed to open file XXXX.u3d for reading" errors, and in the end it loads nothing.

If I try to open them with model viewer...
If I did not use the export resources option, gives "Failed to open file XXXX for reading" errors about every texture file used. Mesh it self appears to be right.
Or if I did export the resources with u3d models. It gives no errors, but every normal mapped material shows up black with some pieces of normal map shimmering white here and there.
Please send me one of the exported *.u3d files. It might be useful for fixing.

I will let you know, when I fix it, but it won't be that soon.
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
57E
Jul 6 2010, 10:23 AM
Yep. I have a random level generator wich makes the the custom u3d mesh based on handful of ds_bin arrays.
Posted Image
Currently generated levels look VERY abstract cubism.
As the gerator script (or what ever would be proper name) I currently use for the modelling code testing only randomly splatters randomly sized blocks on the level and deforms them using sine wave.
Spoiler: click to toggle
The basic funcitions for mesh generating, texturing and deforming are finished.
Only problem is slightly messed shading and the fact I have no Idea why the exporting / importing fails.
Wow, that looks very exotic... :D
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
Dr. Best
Jul 9 2010, 12:59 AM
57E
Jul 3 2010, 12:59 PM
Working on that code...

Exporting meshes goes without errrors, but loading the u3d files with LoadMesh() gives a bunch of "Failed to open file XXXX.u3d for reading" errors, and in the end it loads nothing.

If I try to open them with model viewer...
If I did not use the export resources option, gives "Failed to open file XXXX for reading" errors about every texture file used. Mesh it self appears to be right.
Or if I did export the resources with u3d models. It gives no errors, but every normal mapped material shows up black with some pieces of normal map shimmering white here and there.
Please send me one of the exported *.u3d files. It might be useful for fixing.

I will let you know, when I fix it, but it won't be that soon.
Two *.u3d files. One with exported resources and other without them.
There are polygons missing on three of the sides becouse this is only one 1/8 piece of a level. So it's intentional.
Edited by 57E, Jul 10 2010, 07:17 PM.

Offline Profile Quote Post Goto Top
 
57E
Member Avatar
Forum Leader
[ *  *  *  *  * ]
I got model export / import working. :thumb_up: I don't have any idea what was wrong with it. I've made hundreds of tweaks and fixes to speed up the model generating code since then and didn't test this part of the code until now. :think:

I did as you said:
Quote:
 
Export the custom mesh as *.u3d file and reimport it immediately. Chances are good that SmoothNormals(...) will work fine on the reimported mesh.


Posted Image
PAB off
SmoothNormals(45);


Posted Image
PAB on
SmoothNormals(45);


So it does not work either. Again I tried SmoothNormals with values varying from 22 to 45 and 180 with no noticeable effects.

I have included beter u3d file, similar to that one in screeshots.
This one does not have any "holes" as previous one had.
Attached to this post:
Attachments: temp_mesh1.zip (2.56 MB)
Edited by 57E, Nov 22 2010, 12:33 PM.

Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply