Jump to content


Photo

3d models LOD or occlusion culling


  • Please log in to reply
19 replies to this topic

#1 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 21 November 2016 - 09:56 PM

Run into a little problem with my latest course, where I've been experimenting heavily with 3d models, often ones from sketchup warehouse as vast variety and found importing them pretty straight forward for the most part, although often at the cost of high tris it would seem.

However it seems apparent that 3d objects are not party to any occlusion culling, ie when camera can't see them due to being obscured by trees etc they are still all rendered if witchin the range of the camera.

Is there anything I'm doing wrong that's causing this, or is it just a limitation of the current system?

If it's just the way it is, other than obviously using lower poly models to keep the tri counts down, has there been any though as to using some kind of system where models not visible ie occluded by trees etc are not rendered. Perhaps even some kind of LOD system similar to the speedtree system could be used, loading various detail levels of the models, something along the lines of this asset.

https://www.assetsto...#!/content/4204

I'm assuming it wont work right now as scripts based, but just thought might be something worth considering.

OGT Simulator Tour Admin

 


#2 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 21 November 2016 - 11:14 PM

LOD doesn't work on 3d models.  I've never been able to get it to work and no one, that I know of, has.  The only LOD that works is Speedtree.


Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#3 Jimbobh

Jimbobh

    Advanced Member

  • Members
  • PipPipPip
  • 539 posts
  • LocationMaine

Posted 22 November 2016 - 12:18 AM

In order for LOD to work on a 3d model you would need 3 resolutions of the same model (low med. and high) This gives the LOD system something to work with.

For sketchup models,

My Condo design in Ocean View

D8P5qSd.jpg

 

I try to design them with very little detail on the insides and all interior walls should be the default texture. (light blue)

 

7vAUwdB.jpg

So when viewed in Unity. Those default textured walls are not rendered. so basically the camera is only rendering the outside wall that you can see and not the walls on the inside. At least that's the way I see it.

 

V1B9ayF.jpg

 

If you are importing Sketchup models, they need to be stripped down as much as possible. It can get pretty time consuming. Depending on the type of 3d models you are after, and how much detail the designer put into the model.


Gigabyte ga-z68x-ud3h-b3 Motherboard

Intel Core i5-2400 CPU@3.1GHz 3.70GHz

GeForce GTX 1050 Ti
16GB Ram   (2)G.Skill Ripjaws F3-10666L9S-8GBXL
Windows 7 Home Premium


#4 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 22 November 2016 - 12:58 AM

Me and several others have never been able to get this to work in game.  Sure be nice if you could do a tutorial on this, as I have about a billion rocks on Club Schwarzwald that need LOD's badly.

 

I had 3 levels of LOD and the objects would never display in game.  At the time, no one knew how to fix it.


Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#5 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 24 November 2016 - 10:22 PM

Been playing about with this, Just basically using the LOD Group Component, Removing all but LOD0 and Cull, and then setting the cull point so when far away the model is completely culled from the scene just a test

 

Have got it working in unity itself, but as you describe, it basically then does not show at all in the game.

 

Im assuming because the in game camera is not the same as the "Main Camera" in unity itself, however it works for Speedtrees so not convinced thats the reason.

 

If we could get this working it could be a real great boost to both performance, and also visuals on courses


OGT Simulator Tour Admin

 


#6 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 25 November 2016 - 12:51 AM

Been playing about with this, Just basically using the LOD Group Component, Removing all but LOD0 and Cull, and then setting the cull point so when far away the model is completely culled from the scene just a test

 

Have got it working in unity itself, but as you describe, it basically then does not show at all in the game.

 

Im assuming because the in game camera is not the same as the "Main Camera" in unity itself, however it works for Speedtrees so not convinced thats the reason.

 

If we could get this working it could be a real great boost to both performance, and also visuals on courses

Pretty much.


Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#7 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 29 November 2016 - 12:07 AM

Mike is probably the one to answer this but is the LOD GROUP component specifically disabled for use in game, or is it just something that doesn't work just because it doesn't, if ya catch my drift

OGT Simulator Tour Admin

 


#8 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 20 January 2017 - 01:35 PM

Reviving old question. Was there a resolution to this? I am finalizing House Builder v1_1 and am interested in at least getting "culling" for these houses. I am also debating wilder ideas such as importing my blocks into SpeedTree and seeing if I can get LOD versions going that way but guessing that might be a laughable adventure.



#9 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 20 January 2017 - 07:59 PM

I tried something similar, in that I added a speed tree by manually dragging into the scene, and confirmed the LOD worked in game.

 

I then replaced the Tree meshes with the building meshes, and even then the LOD didnt work when it was a building in game. It makes no sense.


OGT Simulator Tour Admin

 


#10 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 21 January 2017 - 09:48 AM

Ive now got it working :)

 

I havent got multiple LOD Models as really all I wanted was for the object to cull when not in view, ie so only the building for the hole I was on rendered, thus saving all the tris .

 

Ill do a video of how I got it setup later today, but it is basically just using the LOD group component, and ensuring you put the right things in the right boxes. If you set it up as per this video it does work.

 

Thanks to jimbobh for pointing me to this video. Getting this working should open up the use of 3d objects, even ones with higher poly counts even further

 

 

 

I think because I wasnt adding a model into all groups previously that's why it wasnt working right, or i wasnt adding the right object from the prefab, not sure.


  • DPRoberts likes this

OGT Simulator Tour Admin

 


#11 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 21 January 2017 - 02:20 PM

Thanks John. I will build this into the new blocks for the house builder. If someone chooses to plant 100 homes, the 50 well out of view shouldn't keep a stress load on the gpu.

#12 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 21 January 2017 - 07:43 PM

That's exactly what I tried to do on the rocks for Club Schwarzwald.  They would LOD beautifully in Unity, but nothing in game.  I'd love to see some screenshots or video of actual LOD's used for a Course Forge object that works in PG.


Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#13 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 22 January 2017 - 12:50 PM

I will give it a try for a few hours today and report back on any success or failures.

#14 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 22 January 2017 - 01:43 PM

Yeah Ive definitely got it working. Im a bit snowed under with various things at mo, but will try and get a video up later of what I did


OGT Simulator Tour Admin

 


#15 Jimbobh

Jimbobh

    Advanced Member

  • Members
  • PipPipPip
  • 539 posts
  • LocationMaine

Posted 22 January 2017 - 01:55 PM

What I did, that seemed to work, was to add an extra LOD, and in the first 2 slots, (LOD0 and LOD1) I put my LOD0 model (highest Res.) in those 2 slots, Followed by LOD1 then LOD2. Set them to 100% 70% 20% and culled 5%. For some reason, the LOD0 wouldn't show up until I added the extra LOD. Not sure if these %'s are right but is working ok for me.

For models with just 2 LOD's , I did the same. Added the LOD0 to slots LOD 0 and LOD 1 and the Low res. to LOD 3

This is probably not the correct way, but works for me.


Gigabyte ga-z68x-ud3h-b3 Motherboard

Intel Core i5-2400 CPU@3.1GHz 3.70GHz

GeForce GTX 1050 Ti
16GB Ram   (2)G.Skill Ripjaws F3-10666L9S-8GBXL
Windows 7 Home Premium


#16 highfade

highfade

    Advanced Member

  • Members
  • PipPipPip
  • 1,749 posts
  • LocationSouth Africa

Posted 22 January 2017 - 02:41 PM

I tried to cull my seagulls at a certain distance by setting them to a custom layer and it also worked great in Unity but not in the game?


Intel Core i5-6600 CPU 3.3 GHz       Geforce GTX 1060        16GB  RAM       Windows 10 64 bit

Hazyview  (600m above sea level)    --   Nautilus Bay  (Revamp done)  --  Cape Fear  (TGC  adaptation)  --  Aloe Ridge  --  Nahoon Reef GC  --  Chambers Bay 

Abel's Crossing  --  Solitude Links GC


#17 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 22 January 2017 - 07:06 PM

Oh, so you need to fill up ALL the LOD slots for it to work?  I had deleted the ones I didn't want and only had LOD0 filled in.


Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#18 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 22 January 2017 - 11:10 PM

Oh, so you need to fill up ALL the LOD slots for it to work? I had deleted the ones I didn't want and only had LOD0 filled in.


Yes. Thanks to all advice above.

Not sure why but I cannot delete back to LOD0 and cull and have it work either. So, I am just putting the same model in for all 3 and works correctly.

#19 johnmeyer

johnmeyer

    Advanced Member

  • Members
  • PipPipPip
  • 590 posts

Posted 23 January 2017 - 04:38 PM

Its weird, I hadnt read this before crudely knocking up the videos below, and so came up with the theory of the game settings as to why thr LOD0 wasnt showing.

 

Any how for those still not sure of what to put where, there are a couple of videos below showing how I quickly got it working as a demo.

 

As I say very rough rushed videos, but seems to work. 

 

1st one shows me filling all slots and then culling.. good for houses/objects in the distance I guess

 

 

 

2nd one shows the varying LOD levels changing (although as mentioned before no LOD0, maybe to do with in game settings??), creating the object from scratch inside unity with basic 3d objects

 


  • Jimbobh and DPRoberts like this

OGT Simulator Tour Admin

 


#20 highfade

highfade

    Advanced Member

  • Members
  • PipPipPip
  • 1,749 posts
  • LocationSouth Africa

Posted 10 March 2017 - 03:50 PM

Thanks for this!  I can confirm it works for flocking birds too. ;)


Intel Core i5-6600 CPU 3.3 GHz       Geforce GTX 1060        16GB  RAM       Windows 10 64 bit

Hazyview  (600m above sea level)    --   Nautilus Bay  (Revamp done)  --  Cape Fear  (TGC  adaptation)  --  Aloe Ridge  --  Nahoon Reef GC  --  Chambers Bay 

Abel's Crossing  --  Solitude Links GC





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users