I'm using Unity 2019.3.0a2 and created the project with the HDRP settings, at my scene I have a plane with a material using an HDRP/lit shader, the plane contains the video player component and the render mode is set to "material Override" the renderer target is the same of the plane and the material property is "_MainTex".
Problem is I see no video I can only hear the audio, video properties are as follows:
format .mp4, length 6:00, size: 1280x720, 30fps.
I already updated to the latest unity version, also to the latest High definition rendering pipeline available which for me is v6.5.3 and still no video is there any fix for this?
You need to do the following in HDRP:
Create a new material
Change the material Shader to HDRP/Unlit
Drag and drop your RenderTexture onto Surface Inputs --> Color
The HDRP/Lit shader does not have a "_MainTex" property. The property you want to render to is "_BaseColorMap".
Change the Material Property value to "_BaseColorMap".
Found the problem, apparently the best approach is to make a render texture and on the video player you select "Render Texture" and place the newly created "render texture", at the material you just need to place that same texture in the albedo, the details are in the video.
https://youtu.be/KG2aq_CY7pU
Related
I am looking to solve the problem of displaying a transparent video in the AR scenes using Unity ARFoundation and Android platform.
I mean, accurately with a simple effect presented for the iOS platform: https://www.youtube.com/watch?v=vralbqaeqrk
In the normal 3D application I use the transcoded .Webm file and I achieve the intended purpose.
Using the same solution in the AR (ARCore) scene the background color is visible.
Can you use specialized/dedicated assets? Or should I stop dreaming about such a result using Unity and Android?
You need to make sure that your video clip does have an alpha channel then just click keep alpha property in video importing section and hit apply. However it will only show if your video does have an alpha.
Then just attach a Video player component to the gameobject which has a Mesh renderer.
Make sure the Render mode is Material override and Material property tells unity on which map of the material video output will be displayed.
If you want to play it on UI, just make a render texture and assign it to RawImage and assign the Video player with following settings.
Lastly make sure the render texture you created does have support for alpha.
I'm trying to play a video in Unity. I figured it can be done with the VideoPlayer, so I put a VideoPlayer with a RenderTexture on a Plane and created a Material for the Plane that utilises this texture to render the video.
This works fine.
However, the video appears way to bright compared to the original content. You can see this on these pictures:
I found this video https://www.youtube.com/watch?v=KG2aq_CY7pU which looked promising but afterall didn't change the result, the video still appears way too bright.
Here is how I configured the Material
This is how the GO structure is set up
Config of the VideoPlayer
and the config of the Plane
How can I play the video just "normal" like I would see it in VLC Player or any other video player?
P.S. Not sure if it is important but I'm working on an AR Project with Vuforia, where the video is supposed to be played on the image target. But it makes no difference if I play the video on the target or in a scene in Unity, it is the same effect.
Thank you!
Don't use the emission. Instead rather simply use a Shader that is Unlit (basically meaning no shadows, it is always fully illuminated).
In your case you can simply use the built-in shader
Unlit -> Texture and should be fine,
My all project works in UI. One of my scene has videoPlayer and I would like to set my MainCamera to that specific Area. This scene is my Recording scene but for recording I have to use canvas Render Mode and has to be "Screen Space - Camera". How I can set my camera view to that specific area.
I tried 2nd camera with culling mask but didn't work because videoplayer is already my UI's child when camera Renders UI showing all children objects.
Is it possible show to camera whereever I want in UI?
enter image description here
Yessir it sure is. I literally had to do this a couple of days ago. Here is a tutorial/video I followed to figure out how to do it for my application. From the sounds of it, all you need to do is follow the video up to ~3 minutes. Then utilize the end product of getting a camera to showcase something in a UI window for your application.
For reference if the video gets deleted the process is as follows:
Create a new GameObject within the Canvas
Add a Raw Image as a child to to the new GameObject
We want a raw image because Raw Images in particular support the addition of a 2d Texture and this is what we need in order to display the Camera view.
Add a new Camera as a child to the GameObject
Create a new Render Texture in you Project Folder
Add the Render Texture to your Camera's Camera Component in the Target Texture field
Add the Render Texture to you Images Raw Image Component in the Texture field
Move the Camera to what you want to view and it should project to your UI GameObject.
If it doesn't do this correctly or the image has weird aspect ratios, check the dimensions in the Render Texture and your Image. It took me a while to get everything to look normal but it really just takes dimension adjustments.
Hope this helps!
Basically, there is a problem with ARFoundation package in Unity3D.
At first, I generate avatar model from the AvatarSDK. Not really important at this problem. but anyway. It returns skinned mesh renderer with blendshapes.
What I want to do next is to control those blendshapes with my own face through front camera. For this, on my scene I loaded ARSession/ARInputManager, ARSessionOrigin/ARFaceManager.
Then, when by model is generated, I enable ARFaceManager component to track face.
What I see next is front camera image with my virtual model on it.
The problem is I need to track face by front camera, but I do not want to see front camera image on screen.
Can it be solved?
In order to do this, you need to create a new skybox cubemap material first.
After you've done so, navigate to AR Session Origin > Main Camera in your hierarchy and find the AR Camera Background component.
Click the Use Custom Material checkbox and load your newly created skybox material as the custom material.
This will override the default camera material setting.
Good luck!
I was following this blog post on how to implement 360 degree video in Unity. At the end, I used ffmpeg to split the video into individual frames as recommended. I also set the first frame as the texture for each material on each sphere. The end result looks like this
bad sphere
The big problem though is that once I build and run it on my phone or just play the scene itself, the sphere simply fails to render. Could this be caused by the texture being the first frame? Or am I making some other sort of error? Many thanks.
Movies in Unity are usually rendered as textures on objects. On mobile the issue becomes that the device only wants to display video in a video player, so the Unity class MovieTexture is not supported.
I am having success circumventing this, and successfully rendering 360-video on the inside of a sphere using a Unity plug-in from the Unity Asset Store called, Easy Movie Texture.
For working on a Mac, here's what I did:
Download the Easy Movie Texture plug-in from the Unity Asset Store
Open the Demo Sphere demo scene from Assets/EasyMovieTexture/Scene
Create a new (empty) Prefab to your project, and drag the Sphere GameObject from the Demo Sphere scene onto the Prefab.
Reopen your Cardboard scene and drag the new videosphere prefab into your hierarchy.
Open your source 360-video in Quicktime
File -> Export -> 720p
Change file extension from '.mov' to '.mp4'
Drag your new mp4 file into your projects Assets/Streaming Assets directory. Note: don't import through the menu system, as this will force Unity to convert to OGG.
On the "Media Player Ctrl" script component of your videosphere GameObject, locate the "Str_File_Name" field and provide the FULL filename of your newly exported video file. Make sure to include the extension as part of the string, "mymovie.mp4".
Pretty sure that's everything. Hope it helps other folks stuck on this problem.
Final note, the video will only render on the device. In the editor you will only see a white texture on the sphere. You have to publish to the device in order to see your awesome 360-video.