Hello fellow Beam-ers. I am trying to create a full (360 degree) surround view for our academic driving simulator. I am using 6 display channels (i.e., viewports); 3 for the front (Left, Center, Right), and 3 additional for the rear. I have achieved this functionality using C++/OpenGL, and now, I am trying to develop a similar capability within BeamNG.tech.
At present, my composite resolution (using Nvidia surround mode) is 11520x1080; which constitutes 1920x1080 per each channel in a 6x1 configuration.
Using the BeamNG “triple monitor” feature, I am able to successfully create the forward (180 degree) field of view, using 60 degrees per each channel. The resolution is 5760x1080. Now, I am trying to implement a mechanism to create the full rearward views, with the same (5760x1080) resolution. Ideally - this would all happen within the SAME window, but if I had to create a separate window and 3 additional viewports within the same execution instance, that would be satisfactory.
I was wondering if the camera sensor could be implemented for such a task?
If anyone has sample code - or other suggestions - I would be extremely grateful for your guidance.
I wouldn’t suggest using the Camera sensor, as we support this in a different way.
You can render additional views using the toggleSecondView function inside lua\ge\extensions\tech\utils.lua, however we do not expose the configuration yet, so you will need to tweak the parameters inside this .lua file.
These are separate windows for every viewport, but you have the option of having them borderless.
Let us know if you encounter issues during the setup or if you need some help tweaking the parameters of these additional views.
Adam, thank you very much - this option appears to have promise. I do however have some follow-up questions regarding “togglesecondview”.
Are the parameter settings found within utils.lua documented somewhere? I’d like to read further to make sure I have a clearer understanding.
How do I turn on the second viewport? I assume that I would toggle M.secondViewOutput = 1 (i.e., from “0”), but I tried this, saved the file, and it didn’t seem to do anything.
When the second viewport appears, where will it appear in window space? Can I somehow assign the (x,y) screen coordinates to define the window location, and if so - how? I’d like to assign the window to be immediately adjacent to my forward view, which goes from (0,0) to (5760, 1080), since I am using your “multimonitor” feature.
I would like to use the “multimonitor” feature for this second window, just like the first window - and at full HD resolution (i.e., 5760x1080). Is this possible, and if so, how would I assign this option?
I have provided the “toggleSecondView” code snippet below from the utils.lua file. Is there any way that you (or another BeamNG technician) could advise how to adjust these settings to my stated needs? If so - thank you for your time and guidance!
M.secondViewOutput = 0
local function toggleSecondView()
local outputs = core_settings_graphic.getDisplayInformation().outputs
M.secondViewOutput = (M.secondViewOutput + 1) % (tableSize(outputs)+1)
extensions.tech_multiscreen.removeAllViews()
if M.secondViewOutput == 0 then
return
end
local output = outputs[M.secondViewOutput].region
dump(output)
local camNodeID, rightHandDrive = core_camera.getDriverData(be:getPlayerVehicle(0))
local view = {
name = “Second view”,
position = vec3(0, 0, 0),
offsetNode = camNodeID or 0,
rotation = quatFromEuler(0, 0, 0),
resolutionX = output.width, resolutionY = output.height,
renderDetail = 0.3,
fov = 45,
nearClip = 0.1, farClip = 1000,
enableShadows = 1,
windowX = output.left, windowY = output.top,
borderless = true
}
extensions.tech_multiscreen.addView(view)
end
Please note that adding additional features may require further customization, which can be done either by the user or by us. However, any customization on our end is subject to our discretion.
Hi! @khulme
From our previous experiences consider the limits of rendering vs. FPS.
Since working with BeamNG, we aimed for a tripple 4k setup, beginning with a Nvidia 1080Ti, later a 3090 and now a 4090, only the latest card was able the achieve sufficient FPS and graphic quality rendering 11.520x2160px.
Did anything change in the multi-graphic-card support in BeamNG?
Because if it still supports just one card, the possibility will be always limited by the newest generation of hardware.
Another question:
Force feedback and sound is dissabled, when the current BeamNG window is not in focus, can this be a problem, when having several windows rendered?
Lukas, I was able to get the 2-window 6-viewport arrangement somewhat functional. It is a work in progress for me. Full resolution is 11520x1080, and I am able to achieve and maintain a 40-50 Hz frame rate for many of the built-in scnes within BeamNG, including the “Italy” model with traffic.
I still have to perfect soft edge blending at the seams for my application, which involves front projection.
We have a highly-capable workstation with a 4090 Nvidia card, which is helping us achieve desired performance.
BeamNG does not currently support multi-GPU configurations like SLI, which means it can use only one GPU at a time. Attempting to use two GPUs with BeamNG or switching GPUs during runtime (e.g., with dual monitors connected to different GPUs) can cause crashes or other issues.
Regarding force feedback and sound when the window isn’t in focus, this is intentional. You can adjust this by going to Options > Audio and unchecking “Mute when window is not in focus” to keep them active across multiple windows.
Well with the GTX4090 available, I think research with only fewer comprimises is served well enough. In past times, not beeing able to render simulator-resolutions and beeing limited be the newest but still to week graphics card, was frustrating (but understandable from a game dev/render perspective)
Just giving the wink, that incoming more demanding BeamNG versions should be developed with scalability in mind.