0
\$\begingroup\$

I'm new to Unity and am trying to create a sort of CRT computer monitor/terminal with text. To draw the text, I set up a Text Mesh Pro with its own camera, which renders to a Render Texture. enter image description here

I then designed a simple computer monitor model in Blender split into two objects: one for the glass part of the screen, and another for the 'rest' of the monitor exterior case. I saved a copy of the .blend file into the Assets folder and imported this into Unity.

My blender model: (two separate objects, with the separate "screen" piece moved out of the screen) enter image description here

When I try to apply the Render Texture onto the screen object, the texture is rotated 90 degrees anti-clockwise and is too zoomed in: enter image description here I can't seem to rotate the texture so that it is the right way up to read the text, and only some of the text is visible. I have tried rotating the object 90 deg. clockwise in Blender and "applying" the transform so unity then thinks the object is oriented correctly. this still caused the texture to be rotated.

I also tried exporting as an .obj file, with "Up" set to "Y-Up", but this didn't work. I then tried applying the Render Texture to a material, which I then applied to the screen object which didn't work either. If I apply the texture to a standard cube in Unity, it works fine and is rotated and scaled correctly to fit the cube.

How can I get the blender object oriented correctly so that the Render Texture applies in the correct orientation and scales so the whole of the Render Texture fits and is not zoomed in?

I'm using Unity 2019.3 and Blender 2.82.

\$\endgroup\$
  • \$\begingroup\$ It looks like you need to adjust your UV Texture Coordinate unwrap in Blender \$\endgroup\$ – DMGregory May 28 at 15:43
  • \$\begingroup\$ @DMGregory Yes, thank you! That's solved the rotation problem. I'm new to Unity and Blender and wasn't aware of UV unwraps. Thank you! \$\endgroup\$ – cobbm May 28 at 15:59
  • \$\begingroup\$ If that solved your problem, want to write up the steps you took to solve it as an Answer below? This can help future readers who run into similar trouble. \$\endgroup\$ – DMGregory May 28 at 16:00
1
\$\begingroup\$

As pointed out by DMGregory, the problem was with the UV Texture Coordinate unwrap in Blender (which I think must have been caused by the way I created the two separate parts of my model).

To reset the unrwap, I selected the faces of my "screen" object in Edit mode, then selected "Unwrap" from the UV menu. (This can also be done by pressing U with the faces selected)

With the UV map reset back to its default, the orientation and scaling of the Render Texture was now correct, and I was able to tweak the exact positioning/scaling of the texture with the Tiling and Offset controls for my material in Unity.

| improve this answer | |
\$\endgroup\$
-1
\$\begingroup\$

You're making this way more complicated than it needs to be. Create a world-space canvas to display the text, and attach it to the front of the monitor GameObject.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.