Holidays here we come !!!
:)
Remember, if you write a comment and it doesn't appear then it's stuck in my anti-spam mechanism. I will unlock them when I am back!
cya !!
Holidays here we come !!!
:)
Remember, if you write a comment and it doesn't appear then it's stuck in my anti-spam mechanism. I will unlock them when I am back!
cya !!
I am becoming a .Net/C# fan
With it's reflection ability, you can do some nice things. For example output all public data values of an object onto your screen. A little minimal example for Unity debugging/tweaking purposes …
Let's say we have two classes with public data we are interested in
class MyDataOne : Object
{
public float AirDensityRo = 1.225f;
public float LengthInMeters = 2156.33f;
public float MetersPerSecond = 2.0f;
}class MyDataTwo : Object
{
public int Iteration = 0;
public float Offset = 13.0f;
public float Affinity = 2.0f;
}
We then save both instances into a list
List<Object> DisplayedDataObjects = new List<Object>();
void Start()
{DisplayedDataObjects.AddRange(new Object[] { new MyDataOne() , new MyDataTwo () });
(…)
And in the OnGUI context you can draw the values for example like this
(…)
float yOffset = 15;
foreach (Object obj in myDisplayedObjects)
{
yOffset += 5;
GUI.Label(new Rect(5, yOffset, 240, 20), "== " + obj.ToString() + " ==");
yOffset += 15;
FieldInfo[] fields = obj.GetType().GetFields();
foreach (FieldInfo field in fields)
{
if (field.GetValue(obj) != null)
GUI.Label(new Rect(1, yOffset, 240, 20), field.Name + ": " + field.GetValue(obj).ToString());
yOffset += 15;
}
}
The nice thing is that you can rename (refactor) member names and classes without worries as changes will visible immediately. With the list you can also modify quite quickly in what objects you're actually interested in.
The reflection stuff is in "System.Reflection".
Just a little note, mostly for that I remember it better in the future
. Like Virtools, Unity's coordinate-system is Y-Up, unlike 3ds max where it's Z-Up.The Virtools exporter does all the conversion for you under the hood (except for Characters).
Looks like for Unity you need to pay attention. Currently my level in Unity is rotated 180 degrees around the up-axis, compared to the 3ds max scene. I realized that a bit late … Anyways, for characters, car and the like one can do the following to get the same Z-Axis alignment as forward orientation in both applications:
Go into pivot-edit mode ("Affect Pivot Only" in the Hierarchy of the Command Panel) and rotate the pivot so that Z-Axis (blue) points forward, the Y-Axis points upwards and the X-Axis points to the side (left side). Then in the FBX export dialog choose "Z-Up" under "Axis Conversion". This way, it's very close to the Unity system - only the X axis is mirrored.
I've already my roads most of the time hovering above the terrain but still sometimes the terrain temporarily "shines" through depending on distance and view angle. I guess it's due the terrain's LOD, so some polys might become higher than intended on some LOD levels.
In Virtools there is something called "Render Priority": a per-object settings that can be adjusted in the hierarchy manager. It can help for these kind of situations. I was looking for something similar in Unity. The editor itself doesn't seem to have anything related but the shader framework, called ShaderLab, itself has.
So you have to download the built-in shader sources, and create a derivate. First I thought it's the SubShader RenderQueue-Tag, but that didn't had any visual impact. You have to adjust/bias the z/depth buffer value via the Offset state.
In my case I went through the "diffuse" shader and added an "Offset -1,-1" to any spot where RenderStates where set. Like you can see from the image above, it helped a lot. Unfortunately it's not perfect, I am still having tiny but annoying cracks here and there when driving or flying along the roads:
I guess I've no choice and adjust further the terrain heights manually to get rid of them…
When I recently read about something called "R-Screen" on Dassault Systemes blog "3D Perspectives", it reminded me of something I saw a couple of years ago.
R-Screen is a VR installation created with 3DVIA Virtools (VR pack) and is basically a rotating stereoscopic (rear-pro) screen that aligns towards the viewer based on head-tracking data. It allows to move around a virtual object which increases the feeling of immersion.
Something of similar purpose is Alias Research's "Boom Chameleon" from 1998/99 or so. You basically move a screen attached to a boom around it's center center like a window to the VR world. Nowadays with camera tracked markers, we have this even as Augmented Reality on portable devices! Interesting though how old these concepts are. Another demo shows a Mixed Reality example where objects are staged and affect a virtual scenario. This is called a Tangible Interface.
There are a few more (old but interesting) videos online from Alias Research (they take a while to load).