omniglitch Posted September 6, 2011 Share Posted September 6, 2011 Something odd I've noticed is that all of the models I make in Blender (which are exported to .fbx then converted to .gmf with the fbx2gmf tool) appear Gouraud shaded by the engine, yet the sample models that came with the SDK and models created by code, like CreateCube(), appear flat shaded. To show you what I mean, the left cube in the image below was created with CreateCube() and the right cube was created in Blender--I just exported the default cube blender starts with. Both cubes use the same material, which includes both diffuse and normal textures. For most models I'd rather avoid Gouraud shading, as it's often quite ugly. Is there something I have to do in the art pipeline to have models use flat shading, like the sample models appear to use? Is there some command to set the shading type for a model? Quote Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 6, 2011 Share Posted September 6, 2011 Hmmm interesting. Can't say I've had the same problem. Then again I use UU3D to export to gmf so that may be the difference. BTW: It's difficult to tell exactly what the differences are in that render because the models are different distances away and the lighting on both models is different. If you took a screen shot of a frame where both cubes are the same distance away and and with the same shadows it would be easier to see the exact differences. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2011 Share Posted September 7, 2011 an exported uu3d created cube will suffer the same problem... it has to with the normals i would suspect... in the following picture, i have created 4 cubes. listing them left to right: 1) CreateCube() 2) UU3D created cube saved as gmf 3) 3DWS created cube saved as gmf 4) Another modelling program created cube with small chamfers on each corner and converted to gmf using uu3d if you add a really small chamfer to all the edges of the cube, you should be able to fix the issue Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Canardia Posted September 7, 2011 Share Posted September 7, 2011 UU3D has that bug, as you can see from your screenshot too, that it doesn't create evenly shadowed surfaces. I have to run always 3D Tools -> Unweld Faces, to make them look correct. Here's what I mean: Default UU3D cube, with shadow bugs: Unweld Faces cube, now faces are correctly shadowed: Of course, in-game you need also some glossy cubemap (like in Filax's parfume shop demo), to make it look more real, or at least a specular map. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2011 Share Posted September 7, 2011 ooo nice find... i tried about every other 3d tool except that one... so no need for the chamfers if you use uu3d... nice. but if he doesnt have uu3d he will need to chamfer... unless his modelling app has that ability as well... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
omniglitch Posted September 7, 2011 Author Share Posted September 7, 2011 I've tried the chamfering technique before with other engines, but it's pretty labor intensive (or maybe I was doing it the hard way). I like the unweld feature in UU3D. It greatly multiplies the number of vertices, but the results are worth it in my opinion. I was pretty much already sold on getting the full version of UU3D, now I'm really sold on it. Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2011 Share Posted September 7, 2011 yes uu3d is really nice and has alot of very nice hidden features in it... and it doesnt appear to make more vertices as far as the GMF is concerned... when i counted the vertices in a plain uu3d exported cube and an unwelded face uu3d exported cube, the number of vertices was the same... granted a cube is pretty basic... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted September 7, 2011 Share Posted September 7, 2011 Leadwerks Engine just displays whatever the normals in the file are. Nothing less, nothing more. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted September 7, 2011 Share Posted September 7, 2011 This Unweld only aligns the vertex normals to the same direction as the face normal. The default cube in UU3D has the vertex normals in a 45 degree direction facing outwards from each corner of the cube. For rounded objects this works, but for sharp edged objects it looks bad, because some places get darker than the they should. Maybe the intensity of the gouraud shading could be adjusted with a higher ambient light, but then the whole scene would look ugly again. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
franck22000 Posted September 7, 2011 Share Posted September 7, 2011 in UU3D: 1- Select all faces 2- 3D Tools > autosmooth faces > face normals and it should look fine now Quote You guys are going to be the death of me. Josh Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 7, 2011 Share Posted September 7, 2011 I've tried the chamfering technique before with other engines, but it's pretty labor intensive (or maybe I was doing it the hard way). I like the unweld feature in UU3D. It greatly multiplies the number of vertices, but the results are worth it in my opinion. I was pretty much already sold on getting the full version of UU3D, now I'm really sold on it. Chamfering is super easy in Blender. Do you use the edge loop command? Just hit ctrl+r and then it will let you put edge loops in between polygons. Then it will let you slide these loops up and down. Slide them up to the edge where you want to make a chamfer and done. Yes it does increase the poly count but that is the challenge. Where is it worth incresing for a good look? All questions that you gotta ask youself. As for the normals, its a good idea to get that right in blender before export. There are a few tools in the 't' and 'n' panels for showing normals and editing and flipping them. Concerning UU3D: I don't recommen unwelding the UV's. By doing this you are creating a tonne of extra vertices in the UV map. Every vertext that is unwelded becomes 2 vertices. If you completely unweld a plan that consists of 4 quadrants then that converts the 1 vertex in the middle to 4 verticies...... Not very efficient and not recommened. You generally want to keep your UVs stitched together as much as possible. You may not notice the verticies in any vertex count but it doesn't change the fact that the UV map has more verticies = bigger UV file = longer processing of UVs. TBH I don't know what you guys are talking about with UU3D. The reason that cube looks funny that Metatron posted is because its using shaded smoothing and its edges have too great and angle between faces to get a good result from that. That is what shaded smoothing will do.... If you want flat smoothing.. don't auto smooth and don't export smoothing groups. I seriously cannot replicate this problem on my system...... Edit: If you are going to make a cube with hard edges like you would for a crate for example... Don't use smooth shading and don't export any smoothing groups. Edit2: UU3D is excellent. One of the best value for money software I've gotten. Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
macklebee Posted September 7, 2011 Share Posted September 7, 2011 its easy to reproduce in uu3d... just create a cube via uu3d and then save as a gmf. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
tournamentdan Posted September 8, 2011 Share Posted September 8, 2011 As Engineer Ken said try recalculating normals in blender then export.Even watch for doubles, they can do funny things. Quote Link to comment Share on other sites More sharing options...
Richard Simpson Posted September 8, 2011 Share Posted September 8, 2011 I use the method Metatron uses because Blender has done the same to me in the past, Ive also had trouble with recalculating normals in blender. It seems to flip some faces the wrong way, so When I load it into leadwerks, im seeing lots of back faces, as well as correctly flipped faces. :S Quote Intel core 2 quad 6600 | Nvidia Geforce GTX460 1GB | 2GB DDR2 Ram | Windows 7. Google Sketchup | Photoshop | Blender | UU3D | Leadwerks Engine 2.4 Link to comment Share on other sites More sharing options...
Bolt Posted October 2, 2011 Share Posted October 2, 2011 UU3D has that bug, as you can see from your screenshot too, that it doesn't create evenly shadowed surfaces. I have to run always 3D Tools -> Unweld Faces, to make them look correct. It's not a bug, it's by design. Currently, there are no tools in Unwrap 3D to edit the vertex normals separately, so Unwrap 3D will calculate its own vertex normals based on how edges are connected. So, if all edges belonging to a vertex are connected, it will look smooth. The default box primitive is fully welded, so all vertices will look smooth. This is by design. But, to overcome this limitation, Unwrap 3D has many tools to unweld edges. The best tool is AutoSmooth Faces, which works exactly like the AutoSmooth tool found in 3dsmax. It unwelds sharp edges, while keeping flat edges smooth. This is especially useful for models that have curved surfaces, such as barrels, poles, cylinders, or cones. If there were tools in Unwrap 3D to edit vertex normals, it would probably work like Maya. In Maya, you can make an edge hard or soft, and this will change how the vertex normals appear at that edge. Hard edges appear sharp, and soft edges appear smooth. I would prefer implementing this method over 3dsmax's smoothing groups, as I see it as being easier to use and understand. Now, if you're wondering what happens to vertex normals when exporting to a GMF file, you can be assured, that they won't change. The same vertex normals you see in Unwrap 3D are the same vertex normals that are exported to GMF. So, what you see is what you get, in terms of vertex normals. I hope that helps. Quote Ultimate Unwrap 3D: http://www.unwrap3d.com Link to comment Share on other sites More sharing options...
Canardia Posted October 2, 2011 Share Posted October 2, 2011 Ah yes, AutoSmooth sounds good, because indeed on soft edges, like on a sphere they should be welded. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.