Setting SteamVR Camera Target Eye before SteamVR installed in Unity

I’m writing a plugin that can be used in both VR and non-VR projects. I have a Camera that is used to display UI containing some game info on a secondary monitor. My problem is that when the end-user adds my plugin and then imports steam vr, this UI camera’s Target Eye is set to “Both” by default.

I can’t have any SteamVR code in my plugin. But I can’t adjust Target eye property of the camera without it. I just want it so that the camera doesn’t change when a user imports SteamVR. I want it to always render to the main display (target eye = none)

So just to clarify,

  1. I have my plugin, written in a non-vr project with a standard Unity camera. There is no Target Eye setting for this standard camera.
  2. User wants to use it in VR project, imports plugin into SteamVR Project
  3. Camera used to render UI gets automatically converted (wrongly) into SteamVR camera
  4. Defaults to Target Eye = Both
  5. Need it to be Target Eye = None

At the moment to avoid users submitting countless bug reports, I have to provide warnings in like 6 places telling users to dig way into my built-in prefabs to adjust this setting manually if they use SteamVR. It’s not easy for new Unity users, and I want to make adoption as easy as possible.

Why when using escape key to go back to the main menu the preview camera is not working good?

I created a Render Texture named it : GUICameraRenderTexture

This is a screenshot of the Player camera : I assigned to the Target Texture the new GUICameraRenderTexture :

Player Camera

Then on the bottom of the hierarchy I have a Main Menu > Camera : The new Camera I changed the Clear Flags to Don’t Clear and Culling Mask to Nothing :

GUI Camera under Main Menu

Then there is a Canvas the Canvas Render Mode is set to Screen Space – Overlay

And last the Raw Image I assigned to the Texture the GUICameraRenderTexture :

Rae Image

I want to start the game with the Player camera and then on escape key to switch to the main menu gui camera.

Screenshot if I’m disabling the main menu gui camera :

No cameras to render

Then I added a script to the Main Menu object :

using System.Collections; using System.Collections.Generic; using UnityEngine;  public class Switch : MonoBehaviour {     public GameObject[] cameras;     public RenderTexture guiCameraRenderTexture;      // Start is called before the first frame update     void Start()     {      }      // Update is called once per frame     void Update()     {         if(Input.GetKeyDown(KeyCode.Escape))         {             var cam0 = cameras[0].GetComponent<Camera>();             cam0.targetTexture = guiCameraRenderTexture;              cameras[1].SetActive(true);         }     } } 

In the editor I disabled the new main menu gui camera and it’s childs and enabled the player camera without the GUICameraRenderTexture the Target Texture is null on start.

When I hit the Escape key when the game is running it’s showing the preview camera but also showing the player camera and not the main menu gui camera :

Player Camera only

On the escape key it should bring the main menu like in the first screenshot here. If I’m doing the changes removing the texture target and enable the gui camera it will work but using the script it’s not working.

It’s showing the player camera on both preview(rawimage) and gui camera.

The goal is to make the escape key to go to the main menu the gui main menu camera should be black and the player camera should be show in the preview rawimage.

Need help to make and optimize a dense forest in Unity with bird view camera

I’m currently developing a RTS game that has a bird view camera operating while playing the game. One of the core aspects of my game are trees.

So in the previous days i was playing with trees in Unity.

  • First i played with Unity Tree Creator however later i realized it is broken since 2018.3, and devs said it wont be fixed because it will be a community developed package in the future
  • Then i downloaded assets from the store that are said to be highly optimized trees, however they are mostly for “3rd person camera projects” thus having around 7-14k triangles.

After these experiences, i decided to export a tree prefab to fbx, then manually decrease the triangle count to around 2.5k in 3ds max, then reimport it to Unity. With this technique i was able to produce quite good results, but still not very satisfied with it.

My camera view, and my “dense forest” 180-300fps… and only like 3-4 shadows enter image description here For the above picture i used a Tree with 2 LOD and one billboard(BB).

After playing with this i realized i can sure do better especially with playing LOD numbers, material optimization, and with the default tree trinagle optimization.

However the problem is i can’t model pine trees that satisfy my needs in 3ds max. So i started looking into SpeedTree documentation, however it seems a bit too professional for my needs(All the tutorials also make trees with like 20k poly/tri).

So regarding this story. I would like to ask the following question + a bonus one about LOD:

  • Can you model quality trees with SpeedTree for Unity that have like around 1k-2k triangles, or SpeedTree is for high quality/high poly trees, they algorythms won’t work with lower polygon count etc? (I heared they have a simplify modifier is it good? like make a 7k triangle tree then cut it to 1k-2k)
  • I’m thinking about using 4-5 LOD and a BB for smooth transition. In my picture i use 2 LOD and a BB and sometimes when moving the camera fast, transitions are not as smooth as i want it to be. So i would like to rather have more lower detailed meshes before trasitioning to BB. So does having a 4-5 LOD-s a common practice or any better ides for this?

multiple /dev/video devices for 1 camera causing issue with udev rules

Since upgrading from ubuntu 16.04 (kernel 4.15.0-60-generic) to 18.04 (kernel 5.0.0-27-generic) v4l now returns multiple /dev/video devices per physical device. This causes issues when trying to map video devices to aliases using udev rules. One of the /dev/video devices can stream video, the other cannot. The udev alias I’ve created does not seem to consistently choose the correct /dev/video index (the one with streaming capabilities).

I know this post is very similar to this:

Four /dev/video entries but just one camera

However, the accepted answer (bug with skype) does not adequately address the udev issue I’m experiencing.

I see someone has a similar question on stack exchange:

https://unix.stackexchange.com/questions/512759/multiple-dev-video-for-one-physical-device

However, no answer has been accepted.

Additional Information:

Computer make/model: Asus ROG GL503V

Webcam make/model: Genius WideCam F100, Logitech C920, and more.

v4l2-ctl --list-devices

returns:

USB2.0 PC CAMERA: USB2.0 PC CAM (usb-0000:00:14.0-11):  /dev/video4  /dev/video5  USB_Camera: USB_Camera (usb-0000:00:14.0-3):  /dev/video0  /dev/video1  HD Pro Webcam C920 (usb-0000:00:14.0-4.1):  /dev/video6  /dev/video7  USB2.0 HD UVC WebCam: USB2.0 HD (usb-0000:00:14.0-7):  /dev/video2  /dev/video3 

Here’s a detailed look at the Genius WideCam F100:

user@AsusROG:~$   sudo v4l2-ctl --list-devices USB_Camera: USB_Camera (usb-0000:00:14.0-3):     /dev/video0     /dev/video1  USB2.0 HD UVC WebCam: USB2.0 HD (usb-0000:00:14.0-7):     /dev/video2     /dev/video3  user@AsusROG:~$   sudo v4l2-ctl --device=/dev/video0 --all Driver Info (not using libv4l2):     Driver name   : uvcvideo     Card type     : USB_Camera: USB_Camera     Bus info      : usb-0000:00:14.0-3     Driver version: 5.0.21     Capabilities  : 0x84A00001         Video Capture         Metadata Capture         Streaming         Extended Pix Format         Device Capabilities     Device Caps   : 0x04200001         Video Capture         Streaming         Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture:     Width/Height      : 640/480     Pixel Format      : 'YUYV'     Field             : None     Bytes per Line    : 1280     Size Image        : 614400     Colorspace        : sRGB     Transfer Function : Default (maps to sRGB)     YCbCr/HSV Encoding: Default (maps to ITU-R 601)     Quantization      : Default (maps to Limited Range)     Flags             :  Crop Capability Video Capture:     Bounds      : Left 0, Top 0, Width 640, Height 480     Default     : Left 0, Top 0, Width 640, Height 480     Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 640, Height 480 Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480 Streaming Parameters Video Capture:     Capabilities     : timeperframe     Frames per second: 30.000 (30/1)     Read buffers     : 0                      brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0                        contrast 0x00980901 (int)    : min=0 max=95 step=1 default=32 value=32                      saturation 0x00980902 (int)    : min=0 max=100 step=1 default=55 value=55                             hue 0x00980903 (int)    : min=-2000 max=2000 step=1 default=0 value=0  white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1                           gamma 0x00980910 (int)    : min=100 max=300 step=1 default=165 value=165            power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=1       white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=10 default=4600 value=4600 flags=inactive                       sharpness 0x0098091b (int)    : min=1 max=7 step=1 default=2 value=2          backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=0 value=0                   exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3               exposure_absolute 0x009a0902 (int)    : min=50 max=10000 step=1 default=166 value=166 flags=inactive user@AsusROG:~$   sudo v4l2-ctl --device=/dev/video1 --all Driver Info (not using libv4l2):     Driver name   : uvcvideo     Card type     : USB_Camera: USB_Camera     Bus info      : usb-0000:00:14.0-3     Driver version: 5.0.21     Capabilities  : 0x84A00001         Video Capture         Metadata Capture         Streaming         Extended Pix Format         Device Capabilities     Device Caps   : 0x04A00000         Metadata Capture         Streaming         Extended Pix Format Priority: 2 

Here’s the versions of various v4l packages I have installed:

ii libv4l-0:amd64 1.14.2-1 amd64 Collection of video4linux support libraries ii libv4l-dev:amd64 1.14.2-1 amd64 Collection of video4linux support libraries (development files) ii libv4l2rds0:amd64 1.14.2-1 amd64 Video4Linux Radio Data System (RDS) decoding library ii libv4lconvert0:amd64 1.14.2-1 amd64 Video4linux frame format conversion library ii v4l-utils 1.14.2-1 amd64 Collection of command line video4linux utilities 

here’s an excerpt from lsusb:

Bus 001 Device 017: ID 0458:708c KYE Systems Corp. (Mouse Systems) Genius WideCam F100

and the associated udev rule:

KERNEL=="video?", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="0458", ATTRS{index}=="0", ATTRS{idProduct}=="708c", SYMLINK+="v4l/hd_cam" 

Any input would be greatly appreciated

Camera and Mic no longer detected (Kubuntu 18.04)

I tried to get on a Skype call yesterday, but it said I had neither a camera, nor a microphone. I had just had a working Skype call last week, so this is a new problem. This happened after a (very necessary) updating of applications, so I assume something there may have affected something.

How do I properly diagnose this problem and get my camera and microphone working again?

camera stays busy after stopping code

I installed spyder2.X. with Ubuntu 16.04, gave me this message:

Spyder crashed during last session.          ........         ....... 

then, installed it by:

sudo pip install -U spyder 

this commend installed spyder3

the problem:

when running the code from spyder, the camera stays busy after stopping running.

when running the code from the terminal, everything is ok.

I read more about this problem, one comment is very hard https://github.com/spyder-ide/spyder/issues/3554 “Closing because this is a Debian/Ubuntu problem because they decided to intentionally break Spyder.”

Also, this enter link description here change OpenCV version but my case is different. my case with spyder, not OpenCV.

the summary:

I can’t use an anaconda library and python3 because of some confliction with ROS library.

please help me or any suggestion

Thank you in advance!

Allow security camera from China to access guest network

What are the risks that we allow security camera made in China to access our modem/router (all in one)? We granted the camera on Guest network which is the only thing we have it on. Our laptops, phones, tablets are connected to the main wifi.

Can they hack into the main wifi from the Guest network? If so, how can we configure to prevent that?

On the main wifi, I enabled “allow only certain MAC addresses”

Three js raycaster WITHOUT camera

I seem to find only examples to use the raycaster with the camera, but none that just have a raycaster from Point A to Point B.

I have a working raycaster, it retrieves my Helpers, Lines etc. but it seems it does not recognize my sphere.

My first thought was my points are off, so i decided to create a line from my pointA to my pointB with a direction like so:

var pointA = new Vector3( 50, 0, 0 ); var direction = new Vector3( 0, 1, 0 ); direction.normalize(); var distance = 100;  var pointB = new Vector3(); pointB.addVectors ( pointA, direction.multiplyScalar( distance ) );  var geometry = new Geometry(); geometry.vertices.push( pointA ); geometry.vertices.push( pointB ); var material = new LineBasicMaterial( { color : 0xff0000 } ); 

var line = new Line( geometry, material );

This will show a line from my point (50 0 0) to (50 100 0) right trough my sphere which is at point (50, 50, 0) so my pointA and direction values are correct.

Next i add a raycaster: To avoid conflicts with any side effects i recreated my points here:

var raycaster = new Raycaster(new Vector3( 50, 0, 0 ), new Vector3( 0, 1, 0 ).normalize());  var intersects = raycaster.intersectObject(target); console.log(intersects); 

Seems pretty straight forward to me, i also tried to use raycaster.intersectObjects(scene.children) but it gives Lines, helpers etc. but not my sphere.

What am i doing wrong? I am surely missing something here.

IMG of the line and the sphere: enter image description here