With Magnific now being able to upscale all the way up to 16x I wanted to try closeup camera angles for the game.
Originally I had not planned to introduce closeups, but as the AI graphics fidelity keeps going up and up, I had to test it.
This is all still exploratory, as I was not a 100% sure whether I want to introduce closeups. In closeup, the animations need to be better and the meshes more dense, and I really do not want to commit to such a workload. But for a scene like this the closeup works great. So I am certain I will be using some tasteful camera angle changes within the scenes for conversations or cutscenes.
The textures are very high resolution, but at very close distances you begin so see how the meshes do not really hold up at all. This is because all the characters in the game are not meant to be seen from too close.
The game has a depth of field setup, where the focus is set to where ever the mouse is pointed at, but for these closeups I wanted the camera with a focus on the characters and blurred backgrounds. So I had to create a function I can call with an action that will force the camera to focus where I want with a control of the size of the bokeh as well.
AutoFocus.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class AutoFocus : MonoBehaviour
{
public bool mouseIsTarget = true;
public float Depth = 5.0f;
public float TargetDepth = 5.0f;
public float recoveryRate = 1.0f;
public Volume postProcessVolume;
DepthOfField tempDof;
DepthOfField dof;
public bool _overrideDoF = false;
public float _focalLength = 70.0f;
public float _focalLengthOverrde = 130.0f;
// Start is called before the first frame update
void Start()
{
if (postProcessVolume.profile.TryGet<DepthOfField>(out tempDof))
{
dof = tempDof;
}
}
public void ForceDof(float _focalDistanceOverride)
{
_overrideDoF = true;
dof.focalLength.value = _focalLengthOverrde;
dof.focusDistance.value = _focalDistanceOverride;
}
public void ForceDofOff()
{
_overrideDoF = false;
dof.focalLength.value = _focalLength;
}
// Update is called once per frame
void Update()
{
//set depth as focus disatance
TargetDepth = Mathf.MoveTowards(TargetDepth, Depth, recoveryRate * Time.deltaTime);
if (_overrideDoF == false)
{
TargetDepth = Mathf.MoveTowards(TargetDepth, Depth, recoveryRate * Time.deltaTime);
dof.focusDistance.value = TargetDepth;
}
RaycastHit hitInfo;
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo))
{
// Ray hit something in scene
//Debug.Log("Ray hit : " + hitInfo.collider.gameObject.name);
Depth = hitInfo.distance;
}
}
}
It is a simple setup but works really well. If I need mode control, I can turn it into a full Adventure Creator actor later.
Character texture upscale
I also ran the main character UV texture trough Magnific.ai to see how that would look. And art does make a major difference.
In extreme closeup the character is still not pretty to look at, but I think it is perfectly passable in-game.
In wide shots the difference in detail is not that observable. But in close up shots it becomes quite obvious. Overall I think the Magnific upscaled texture matches the locations a little bit better.
The Texture
I was not able to get a nice result for the human character from the AI directly. I had to do some overpainting on photoshop. mainly fixing the ears so that the UV’s matched them better and the fingers were a total mess, so I had to kit bash them from the details in the Ai upscale.
This latest texture is an iteration on top of the previous character enhancement step I made with Photoshop’s generative fill.
When working with AI tools, it is common that new breakthroughs happen all the time. This is especially “annoying” in a long term project like mine, where I need to commit to a look down the line and then stick to it. but sometimes it is possible to incorporate new tools that iteratively make the previously generated images better. Magnific.ai is just such a tool. It beautifully enhances the previous generation of textures.
In a fun way, I am continuously remastering the game as I am working on it.
Leave a Reply