I am working on a project that renders something for a native plugin that I wrote for unity, So that it can be used Instancing and other advanced graphics features, I'm developing it for cross-platform release, but I work with Mac, so the test is mainly done with OpenGL. At this point, the plugin only provides a tractor at the center of the color with hex values. The plugin works as expected in a blank unity project, but as soon as I incorporate it into my oculus project, it starts behaving temporarily.
In the crack, pulls the plug-in's geometry twice, once by drawing in both eyes and the second time drawing right under the eye's eye, besides, I lose any primitive colors applied to geometry And geometry appears to take around the colors; On a black screen with red text, geometry with some red haemorrhages in the geometry will be mostly black. As soon as my green terrain is loaded, the geometry captured by the plugin becomes green.
The following is a screenshot of the geometry being pulled in the unity project:
Here is the creation of the orbits that I am rendering (three coordinates And color):
wart Ax Vert [4] = {{-0.5f, 0.5f, 0, 0xFF0000ff}, {0.5 F, 0.5 F, 0, 0x FFF0000}, {0.5 F, -0.5F, 0x, 0x FF00ff00}, { -0.5 F, -0.5 F, 0, 0x FFF 0000},};
Each frame within the plugin is called the Draw function:
// OpenGL case if (g_DeviceType == kGfxRendererOpenGL) {// start the model view Matrix GlamorixSomed (GLIMDLUF); Boat model matrix [16] = {1,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1}; GlLoadMatrixf (model matrix); // Start the Proceeding Matrix Glamorics Moded (GL_ PROJECTION) to your matrix current MatrixSmode //; Projection matrix [10] = 2.0 f; // Projection matrix to match the 3D projection matrix / tweak = [14] = -1.0F; GlLoadMatrixf (projection matrix); // Vertex layout glVertexPointer (3, GL_FLOAT, size (works [0]), & amp; [0] .x); [0]; GlEnableClientState (GL_VERTEX_ARRAY); GlColorPointer (4, GL_UnSIGNED_BYTE, Sagef (Arts [0]), & amp; verts [0] .color); GlEnableClientState (GL_COLOR_ARRAY); GlDrawArrays (GL_LINE_LOOP, 0, 4); }
Any insights from experienced original plugin / crack graphics coders will be appreciated!
You can use the Unity UI system to render sprites according to your needs. Here is an article by Oculus, in which the Unity UI system can be zoomed for VR:
Out of unity, you will use tractor layers to render FOV over the eyes. Layers described in oculus rift documentation:
Tractor layer:
A monoscopic image that is displayed in the virtual world as rectangular in a given currency and size. It's useful for head-up-display, text info, object labels, etc. By default, the currency is specified relative to the user's real-world space, and the tractor will remain stationary in space instead of running the user's head or body with speed. For head-locked quads, use the ovrLayerFlag_HeadLocked flag as described below.
Comments
Post a Comment