View distance

Ask questions, discuss ideas, get answers
Matchy
Posts: 13
Joined: Sat Mar 06, 2010 11:37 am

View distance

Post by Matchy »

I want an object or effect to only show up when you get really close to it.
To stop any lag it creates when not in use.
any one know the view distance line ? lol i'm such a noob XD
motoko
Posts: 217
Joined: Sun Nov 21, 2010 8:43 pm
Location: Dante's 6th Pit of Hell

Re: View distance

Post by motoko »

Matchy wrote:I want an object or effect to only show up when you get really close to it.
To stop any lag it creates when not in use.
any one know the view distance line ? lol i'm such a noob XD

Code: Select all

Game.setViewDistance 550
in the init.con, maybe?
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Re: View distance

Post by Poow »

You can set this by changing the level of detail settings. In the Geometries.con of each model.

Crane1:
GeometryTemplate.create StandardMesh crane1_m1
GeometryTemplate.file crane1_m1
GeometryTemplate.setLodDistance 0 0 ->LOD 1
GeometryTemplate.setLodDistance 1 15 ->LOD 2 Distance 15
GeometryTemplate.setLodDistance 2 35 ->LOD 3
GeometryTemplate.setLodDistance 3 60 ->LOD 4
GeometryTemplate.setLodDistance 4 100 ->LOD 5
GeometryTemplate.setLodDistance 5 300 ->LOD 6 Distance 300
LOD means Level Of Detail

Just go into bf and look at a model and move back and come closer again. You will see how it change his shape.
Every "higher" LOD is a model with a lower resolution. Because a model doesn't need to look quite good if its 2 pixel big at the horizon. You don't even care about it. But your GPU does ;)

If you did everything correctly, your model should have these LODs.
Image
You’re entering a world of pain!
Matchy
Posts: 13
Joined: Sat Mar 06, 2010 11:37 am

Re: View distance

Post by Matchy »

thank you mates :)
BF-Gamer
Posts: 8
Joined: Wed Apr 04, 2012 5:42 pm
Location: Germany

Re: View distance

Post by BF-Gamer »

I tried this, but it didn't work for me.

I Increased the LODs in the Geometries.con of every Sea Vehicle (objects/vehicles/sea/XYZ/Geometries.con) and the Flags (objects/items/Flag/Geometries.con) around the double value and tested it on the maps "Midway" (American aircraft carrier, seen from the airfield) and "Eagles Nest" (German flag at the middle of the map, seen from the German headquarter).
Both times the same result, it doesn't matter if I use my modified Geometries.con's or the original ones: I can see the objects (Flag and aircraft carrier) only when I zoom the weapon or go a few steps closer to the object.

I have to say, that I modded all my maps to higher view distances and less fog (around 10 times higher than the original ones).
Foresight is great now, but objects are popping up now. Now I want to increase the view distance/LOD of every object.

What did I wrong?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: View distance

Post by Swaffy »

Blue: LOD number (0 is highest detail, 5 is lowest detail)
Red: Distance

If you want objects to be seen from far away:

GeometryTemplate.create StandardMesh crane1_m1
GeometryTemplate.file crane1_m1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 50
GeometryTemplate.setLodDistance 2 100
GeometryTemplate.setLodDistance 3 200
GeometryTemplate.setLodDistance 4 300
GeometryTemplate.setLodDistance 5 500


If you want objects to be seen only from close distances:

GeometryTemplate.create StandardMesh crane1_m1
GeometryTemplate.file crane1_m1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 5
GeometryTemplate.setLodDistance 2 10
GeometryTemplate.setLodDistance 3 15
GeometryTemplate.setLodDistance 4 20
GeometryTemplate.setLodDistance 5 25
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
BF-Gamer
Posts: 8
Joined: Wed Apr 04, 2012 5:42 pm
Location: Germany

Re: View distance

Post by BF-Gamer »

I doubled all the red numbers of every geometries.con in Vehicles\Sea\XYZ.

E.g.:

GeometryTemplate.create StandardMesh PTRaft_Hull_M1
GeometryTemplate.file PT_Raft_M1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 50
GeometryTemplate.setLodDistance 2 100
GeometryTemplate.setLodDistance 3 200
GeometryTemplate.setLodDistance 4 400
GeometryTemplate.setLodDistance 5 800

to

GeometryTemplate.create StandardMesh PTRaft_Hull_M1
GeometryTemplate.file PT_Raft_M1
GeometryTemplate.setLodDistance 0 0
GeometryTemplate.setLodDistance 1 100
GeometryTemplate.setLodDistance 2 200
GeometryTemplate.setLodDistance 3 400
GeometryTemplate.setLodDistance 4 800
GeometryTemplate.setLodDistance 5 1600


But on Midway, all sea vehicles like rafts and carriers have exact the same view distance as before.
Same problem with the German flags in Eagles Nest.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

Code: Select all

ObjectTemplate.active Enterprise
objectTemplate.cullRadiusScale 5 
http://bfmods.com/mdt/scripting/ObjectT ... Scale.html
BF-Gamer
Posts: 8
Joined: Wed Apr 04, 2012 5:42 pm
Location: Germany

Re: View distance

Post by BF-Gamer »

Thanks for that hint! But where can I find these two lines? Searched in the Midway.rfa-Files and in the Objects.rfa-Files.
Or do I have to add them manually? When yes, where?

I found it in the Kursk.rfa, but the values are already "5".
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

some vehicles already have that line in the object.con file and some like the carrier doesn´t. you can add the code pretty much anywhere but if its just for one map it may be easiest to add it to ObjectSpawnTemplates.con
Post Reply