Set LOD based on distance.

Not sure, since I was just made aware of the feature about a week ago. I’ve not even really tested it out myself yet to any full extent. Priority for us right now has been with focus on 4.14 and making that a stellar release. :slight_smile:

I did take 5 minutes and do a simple test with just a sphere and a single LOD and the difference to me is pretty clear. Once we start the 4.15 previews or if you ever use the Master Branch that would definitely be worth checking out on your end and give us feedback if you don’t see it solve the issues. With it not being tied to aspect ratio of the screen now the difference is just that good, to me. As an example, in the Static Mesh editor or the viewport you could originally drag the side bar so that your screen got smaller/larger and you would see the transitions happening with the LODs. That doesn’t happen now from what I see, but again this was a quick test to see the difference.

By , is this happening in 4.15 ?? Really needed feature for mobile VR.

Well, when 4.1 was around VR wasn’t really a big deal. Now that VR, especially mobile VR, is growing big and strong, distance based LOD makes a lot more sense that screen percentage based LOD. Distance based LOD is very critical to mobile VR as actors might be of about same size on the screen, but far enough from the camera to consider LOD switching.

Here is an example. You are standing next to a table with utensils on top of it. Plate/fork/spoon right next to the camera (player) need to have LOD0, while stuff that is not right in front of the camera (player) need to have LOD1, 2, etc. Setting LODs based on screen percentage won’t work for this kind of situation - LOD has to be set based on distance.

I really hope Epic will re-think this (as it is it looks like there is not whole a lot of love for mobile VR in general) :confused:

Referencing my other post above, which you can find linked below.

LOD by distance is not a feature that will be added. I did mention here that there were plans to improve how LODs are handled to make them more consistent for screenspace size between the Static Mesh Editor and viewports. Here is an example of this improvement from the static mesh editor.

**4.14 and prior **

[video]4 14 screensize - YouTube

4.15 and later

[video]4 15 screensize - YouTube

LOD0 Screensize = 1.0
LOD1 Screensize = 0.05

The screens adjustment no longer affects the changing LOD on the screen. This makes it more consistent between viewports with different sizes to accurately set your LODs.

That’s a cool fix, but I still don’t get why Epic doesn’t see benefit for having distance based LOD option as part of stock UE4 (granted, it’s only relevant to VR) :confused: I am pretty sure I am not alone in this.

Is it possible (and if it is, how hard would it be) to make a plugin for UE4 to add “LOD based on distance” functionality ? I am sure many folks would buy that on the Marketplace.

I was supposed to investigate a solution for this months ago, didn’t have the time; I will try to reserve some time for this after I finish some work I have to do this month; hopefully it’s possible as external tool then it wouldn’t interfere with Epic’s plans for the official engine releases…

I would totally appreciate that! (please with Android support)

I would like to be able to get full manual control over LODs, then it would be possible to write any logic LOD changes depending on what you want.
I would also like to be able to get the current LOD value on geometry
(For example, to disable the logic responsible for the visual effects associated with the geometry)

It may have passed some people by as it was not called out prominently in the 4.15 release notes, but with 4.15 LOD calculations were changed, not to allow LOD based on distance,** but to allow LOD “screen sizes” larger than 1.**
The current calculations use a “screen size” metric that amounts to the screen-space diameter of the projected bounding sphere of the object. In this way, we get camera-angle and screen resolution-independent LOD calculations and also handle large/nearby objects.

How should the LOD be handled in VR? One issue I have with screen size is that for every eye the object might have a different screen size, so the left eye can see a different LOD than the right eye, and that looks very wrong.

As I understand it, in VR the screen size is calculated once (although I cant remember whether it is the left or right eye, I dont suppose it matters). Otherwise you get horrible sickening effects where objects end up with two LODs at the same time.

I am seeing exactly these horrible sickening effects, so for some reason it is not working correctly. Are you sure it should only calculate LODs once, even with Instanced Stereo Rendering disabled?

Ah, this may be my bad - there was discussion of this internally pre-GDC as a fix was made for the VR Editor. I’m just trying to trace whether these changes got merged back over. Suffice to say, in 4.15 there is a bug where per-eye you can end up with different LODs being calculated.

Thanks! :slight_smile:

Hmm, on tracing this I found that we were seeing this artifact only when we were using a different FOV for each eye (this was for a crazy internal hack). Could you submit a bug report to the AnswerHub if you are just getting this issue in a regular VR project?

Hm, strange. Already hoped you could just point me to the fix and I could easily merge it.

I’ve created a bug report now: Eyes sometimes show different LODs in VR - XR Development - Epic Developer Community Forums

Also uploaded a repro project there.

Found it!

The fix is ready to go into this week from the Dev-VR branch. Hopefully it should hit by Friday.

Awesome, thanks! :cool:

I hope its possible to easily merge it back into 4.15.

Nice work folks, this certainly curbs my issue and prevents a nasty shader setup.