Forum rules - please read before posting.

How to use a different camera for rendering AC text only?

edited August 2022 in Technical Q&A

I have a project that I'm experimenting with, and I'm thinking of using pixel-art with hi-res text, using AC.

Probably I should use a pixel-perfect renderer on my MainCamera to render the art in a non-jagged way, then add a child camera on it to render all GUI text in display resolution, so that I can use a more legible font compared to pixel fonts. (I don't know if there are any other solutions to this)

Assuming this is the way to go: Is there a way we can assign a layer to all GUI text, so that we can tell the child camera to only see that layer (also we can remove that layer from main camera)? If there is, I can't seem to find the way to do it.

If text is not separable from background elements in menus, the second best option would probably be to assign a special layer to all menus, and then I can manually place menu backgrounds as normal prefabs instead of assigning from AC menu settings, because I'd still want them to be rendered with pixel-perfect cam.

For context: I'm using AC sourced menus instead of Unity UI prefabs, because it's very easy to use and if I go pixel-art route, I guess it will be even easier to use absolute pixels to place background textures for subtitle / conversation menus (they will always appear in the same place on the screen).

Thanks!

Comments

  • AC-sourced menus are renderered with Unity's ImGUI mode, which don't exist in the scene and are applied last in the frame draw-order.

    To have your menus unaffected by post-processing, you'll need to use Unity UI to render them, and move them to a specific Layer that a separate "UI" Camera is set up to render via its Culling Mask.

    Unity UI is recommended for menu building in general - with AC menus being best for rapid prototyping. It may be a bit more tricky to use UI's scaling components, but it's certainly capable of fixed positioning and pixel-perfect rendering - particularly with Text Mesh Pro, which also requires Unity UI.

  • edited September 2022

    Hey Chris, thanks for the reply.

    I tried before and I just tried last night again, but I really struggle to understand how Unity UI works in tandem with AC and how pre-existing canvas prefabs work. I couldn't get to understand it from existing AC tutorials (Perhaps I might have a missed a crucial page hidden somewhere?)

    When I change my current menu to "Unity UI prefabs", default prefab doesn't even appear on screen on the play mode, with my current working file. When I check the prefabs, I see a lot of stacked components, which have properties that doesn't seem to affect anything on the prefab screen as I expect them to.

    I know it's my lack of knowledge that's causing this, but usual learning curve for AC-related things are usually much much easier compared to unity-UI stuff, which seems to be the recommended solution.

    I'd be happy if you can recommend a starting point to watch/read, outside of current AC tutorials perhaps? Thank you for your understanding.

  • edited September 2022

    Outside of AC, I could only point you to Unity's own guide here, or suggest a search of Unity UI tutorials on Youtube.

    Having AC work with Unity UI, and setting up your UI to render with a specific camera, however, should be independent. AC won't control how the UI itself is renderered - only control the elements you link it to, and when the menu is shown.

    I'd recommend first building your UI without any postprocessing or separate camera/layer, and just have it connecting with AC.

    A text tutorial on working with AC and Unity UI can be found here. However, Unity UI is also covered in the video tutorials - for example, in the First Person Primer.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.