Author Topic: Backface Culling  (Read 603 times)

Legacy_ia.Pepper

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
Backface Culling
« on: September 02, 2014, 06:06:40 am »


               

  While working on a new model of mine, it came to mind; is it at all possible to turn off backface culling on a NWN model? Or is that permanently hard-coded? Having to make a copy, and flip all the polygons so nothing is see-through, is quite a pain in the rear.


 


  Another question I think I would have, is if you can turn off backface culling for the model, can you do it for a specific part? And would it be less system intensive to do it that way? Technically, the polygons that are not rendered, are still considered by the program, even if it is briefly. So you're doubling the polygons that it considers, I would think, if you duplicate something and flip it. Though in the end, it's being ignored, I just think having one copy of the model, and making it so both sides render, would be less intensive.


 


 


  Of course, this is all nonsense if NWN doesn't even support that, although it could still be a question for other games, if anyone is knowledgeable enough on the matter. 



               
               

               
            

Legacy_NWN_baba yaga

  • Hero Member
  • *****
  • Posts: 1944
  • Karma: +0/-0
Backface Culling
« Reply #1 on: September 02, 2014, 09:14:45 am »


               

hi there,


 


no backface culling like in halflife or similar. The engine "sees" everything that is within the fog clip distance. And even fog clip seems a bit buggy to me anyway. Maybe it´s my driver but it´s just buggy!



               
               

               
            

Legacy_NWN_baba yaga

  • Hero Member
  • *****
  • Posts: 1944
  • Karma: +0/-0
Backface Culling
« Reply #2 on: September 02, 2014, 03:17:48 pm »


               

I think that is also why we have that walkmesh thing. The engine just works so differernt then any other FPS one there is just nothing like nwn. The only thing that makes sense is to get rid of every face that you definately know is never visible. Bottom faces and so on.



               
               

               
            

Legacy_ia.Pepper

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
Backface Culling
« Reply #3 on: September 02, 2014, 04:16:08 pm »


               

  Ahhh, I mean, the back of a polygon doesn't render normally in NWN. That's also to my knowledge, a form of backface culling. It's obviously a feature, because it doesn't happen by default in coding, but I am wondering if it can be turned off or on for specific models, or parts of models. Instead of copying a model, flipping all the polygons so they face the other way, is it possible to just set it so it doesn't cull the other sides of the polygons, or is that completely hardcoded into NWN?



               
               

               
            

Legacy_NWN_baba yaga

  • Hero Member
  • *****
  • Posts: 1944
  • Karma: +0/-0
Backface Culling
« Reply #4 on: September 02, 2014, 07:03:31 pm »


               

ah ok, now i understand what you mean. You have to create every face that you want to be visible (for tree foilage as an example) . No backface cull like in 3ds max!


 


If you use vel tools there is an option like create "doublesided". I always use this if i do bushes and tree stuff etc.!


 


And yes, sure it is in the engine. It only renders what is truly created. No shader stuff! Simple 3d.



               
               

               
            

Legacy_ia.Pepper

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
Backface Culling
« Reply #5 on: September 02, 2014, 07:18:35 pm »


               


If you use vel tools there is an option like create "doublesided". I always use this if i do bushes and tree stuff etc.!




 


  Ahhh, okay! I didn't know that existed in vel tools, kind of neat. Thanks though! I might still go with another method of preventing see-through, because I feel using any method like that may just lead to a lot of needless polys, considering what I am working on. It's already a very heavy model in terms of polycount, so I want to avoid as best I can, from increasing it needlessly.


               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Backface Culling
« Reply #6 on: September 02, 2014, 11:36:19 pm »


               

NWN does render every face... that is why backface culling is turned ON not OFF.  This is a feature of whatever 3d editing software you use.  3dsmax has a global option to either turn ON backface cull or to turn that feature OFF.  The total number of polys is directly related to whether or not you cull those back faces or not.  NWN will attempt to render and backface poly IF it exists, even when you will never see it.  So, it is typically best to leave back face cull turned ON so that the back faces are NOT created, except in the few instances, like plants, where you might wish to have something visible from the other side.


 


The feature in Veltools is a very powerful feature, and one of the many reasons I recommend using Veltools along side NWmax, so that you have the power to use those extras.  Warning that Veltools doesn't work all that well in later versions of 3dsmax, past version 10.  I have been attempting to fix the features that don't work in the later versions but it proving problematic.  If you have 3dsmax 5-10 veltools will work fine, so will nwmax and velmar's tileset creator, past version 10, multiple features of all of them have issues, some much more problematic than others.  NWMax has been the easiest of the three to get working, but when I fix it to work with the later versions, it no longer works in Gmax correctly, so again, it is proving problematic. 


 


3dsmax version 9 is almost worthless as it doesn't properly save or read what is saved as options... as in adding search folders for paths for textures etc, version 9 does not seem to save those options, even though they are listed in the proper places as optional search paths, when you open a max scene file, version 9 tends to re-adjust the settings according to whatever the scene originally had, even when you change it and re-save the scene... meaning, it never overwrites the actual extra folder locations back into the scene, so, you have to add those folders back to the search path every time you open an older max scene file.  Real, royal, pain in the arse.  Version 10 seemed to handle those options better, but I no longer have a working version of 10 or 11 or 12 or 13, all I have now is 9, and 14 and 15.  I can't get gmax to install on windows 8.1 no matter how I set it up, the setup fails every time.  Even when setting the options to use compatibility mode, it doesn't work.  So, I am having to have someone else test the scripts when I make a change, and so far, I can't seem to get the features to work past version 10.


 


So, anyway, as direct answer to the op question, yes there is an option to automatically turn backface cull OFF, but it is certainly NOT recommended for NWN due to the limits the engine has with calculating the number of faces that are truly visible to whatever position the camera is located, meaning that the engine must recalculate every single face that may be visible, then calculate whether or not that face casts a shadow, so the reduction of faces is the primary goal.  Yes, we, the community in general, has proven that the engine can handle a bit larger number of total faces, but the engine and general game play benefits from having as few total faces as possible on any given object and most particularly in any given 10meter by 10 meter square, which is then added to the total number of faces in the other 8 10x10 squares in any give 3x3 group, where the camera/pc is located in the central square with an extra square visible in every direction from that center.  so, 9 10x10 squares are what the engine calculates against, and what causes the general FPS speed all the way through.


 


My issue has always been that by default, 3dsmax has backfaces turned ON, meaning backface cull is turned OFF by default settings in 3dsmax. Then I have to check against whatever settings any general creator has chosen to implement, I find that I have to wade through each tile and REMOVE back faces a lot of times, to reduce the wasted calculation times, and lost speed.  In general, you are better off with back faces removed except in the few instances where they are actually needed, as in foliage that can be viewed from both directions.



               
               

               
            

Legacy_ia.Pepper

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
Backface Culling
« Reply #7 on: September 02, 2014, 11:54:11 pm »


               

  Thanks for such a detailed reply, Bannor! I figured out a way of not needing all of that, and using way less polys to do so as well. So that's good. I have noticed certain problems with veltools on 3DSMAX, but I think I just need to update and get everything resorted. My files I do not think are the most up-to-date versions, so it's something I have to look into at a later point. I just have not been too bothered, since I have not needed them typically.


 


  I actually worried about the polycount of my model, but I do realize that a large portion of lag from models is whether they have shadows on or off, so that's able to be bypassed. The model is close to the 4k mark, but setting any of it to render shadows would be suicide and I realize that. However, I am just going to make a low-poly dummy of the model to use for shadows, much easier, much less strenuous.


 


  Also, there is a key point of having backface culling turned off while working on a model, you can get inside the model and tweak certain things from there, where it may be difficult to grab say, a vertex, and maneuver it around normally. Being able to manipulate the model from an inside view is quite valuable to me, and perhaps it is off by default, because I am not alone.  '<img'>



               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Backface Culling
« Reply #8 on: September 03, 2014, 12:02:55 am »


               

Yes, it is almost always related to whatever work flow you personally use.  I work from the outside where you appear to work sometimes from the inside.  It all depends on what you are building/working with and with however you taught yourself to work.  Many of the folks in the community are masters at their skills, but I would venture to guess than any 2 of them would accomplish the same result using different workflows.  Some are faster than others for sure... I am VERY slow in comparison to others, but in my defense, I learned by fixing other folks mistakes, so I had to learn what was actually broken first then figure out a way to fix it.


 


Most of the others around here, learned either in some college level course and were taught by other artist masters OR learned by just creating on their own or by watching the 1,000's of various tutorial vids out there... I have watched a bunch of those vids too... although many of them assume that the viewer already knows certain things that I may or may not already understand or do.  I am apparently getting slower with age as well... and my artistic skills were gained from pen and pencil drawing, or using a t-square and drafting table... the 3d graphic stuff does not come naturally to me, and I certainly have a difficult time creating what others consider simple things...


 


No worries, we all learn at our own pace and create things that sometimes the community loves and other times the community never uses... as long as we are having some sort of fun out of the creation process, it truly doesn't matter.



               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Backface Culling
« Reply #9 on: September 03, 2014, 02:09:03 am »


               

Backfaces wouldn't necessarily behave as you expect, anyway. IIRC they'd have their normals facing the same way as the front face, so they'd be lit all wrong.



               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Backface Culling
« Reply #10 on: September 03, 2014, 04:33:56 am »


               


Backfaces wouldn't necessarily behave as you expect, anyway. IIRC they'd have their normals facing the same way as the front face, so they'd be lit all wrong.




 


Ahhh that explains a bit of the issues I have seen when backfaces were enabled... so it changes the lighting... that would make them a royal pain as well.  As I said, I do my best to remove ALL backfaces except in foliage situations where having a backface/textured object is necessary, but with that lighting issue, that explains why they always looked a bit funny to me... so, I guess I need to just generate the correctly faced normals all the way around.


 


Thanks for the tip Six...


 


What have you been up to lately?  Feel like working on a project with me maybe?


               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Backface Culling
« Reply #11 on: September 04, 2014, 11:42:36 pm »


               


Ahhh that explains a bit of the issues I have seen when backfaces were enabled... so it changes the lighting... that would make them a royal pain as well.  As I said, I do my best to remove ALL backfaces except in foliage situations where having a backface/textured object is necessary, but with that lighting issue, that explains why they always looked a bit funny to me... so, I guess I need to just generate the correctly faced normals all the way around.


 


Thanks for the tip Six...


 


What have you been up to lately?  Feel like working on a project with me maybe?




 


It'd be more correct to say it didn't change the lighting '<img'>


 


Rather than clog up the thread with off topic shizzle, I have (I believe) sent you a Steam friend request - under my mysterious other alias.


               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Backface Culling
« Reply #12 on: September 09, 2014, 08:50:21 pm »


               

Incidentally, NWN folks who know me, feel free to ask my for my secret Steam identity in a PM should it be thy wish '<img'>



               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Backface Culling
« Reply #13 on: September 10, 2014, 03:41:47 am »


               

I know it, I know it... 'ornery cuss'... yeah that's it, ornery cuss, right, see, told ya... ornery cuss... geeze, you would think he would pick something no one would ever guess wouldn'tya?