OpenGL Bugs and Issues

#1

Please post any bugs and issues with the OpenGL closed beta here!

#3

Hi,

Ok … ‘what am I doing wtong ?’

So … my code goes along those lines , first -

wp.w = 512;
wp.h = 256;

	window = Util_InitWindowAndGraphics(wp,
		FullScreen, 4, UseAppWindowFrame, &l_pDevice, NULL, NULL, NULL, &error_code); //UseAppWindowFrame, &pDevice);


*the_Neon_Device = l_pDevice;
g_Neon_Device = l_pDevice;

#ifdef USING_HOLOPLAY
PRINTF(“Initializing Looking Glass\n”);
hp_initialize();
#endif

Then in my ‘begin view’ …

if (nviews == 32)
{
	// ok we ARE in openGL !!

	// simple case, simple screen
	g_Neon_Device->SetCurrentRT(-1);

	float fov = 0.244; // 14° in radians
	float viewCone = 0.698; // 40° in radians
	float cameraSize = 5; // for example
	float aspectRatio = 1.6; // derived from calibration's screenW / screenH
	//totalViews = 45 // derived from the quilt settings
	Vector3 focalPosition;// = (0, 0, 0); // the center of the focal pane
	focalPosition.zero();

	float cameraDistance = -cameraSize / tan(fov / 2);
	Vector3 cameraPosition = focalPosition + Vector3(0, 0, cameraDistance);

	proj = glm::perspectiveRH(
		SCE_MATH_PI / 4.0f,
		(float)w*0.5f / (float)h,
		//1.0f,
		0.1f, // z near
		20.0f); // z far

	g_Neon_Device->camera(0, 0, 3,
		0, 0, 0,
		0, 1, 0,
		&view, true);

	// now let's do what they do

	//PRINTF("View Index %d\n", view_index);

	// start at -viewCone * 0.5 and go up to viewCone * 0.5
	float offsetAngle = ((float)view_index / (float)(nviews - 1) - 0.5) * viewCone;

	// calculate the offset
	float offset = cameraDistance * tan(offsetAngle);

	// modify the view matrix (position)
	view[0, 3] += offset;

	// modify the projection matrix, relative to the camera size and aspect ratio
	proj[0, 2] += offset / (cameraSize * aspectRatio);

	g_Neon_Device->setProjection(&proj);
	g_Neon_Device->setCamera(&view);

}

Then it draw some cubes

	the_Neon_Device->setWorld();
	the_Neon_Device->scale(0.3, 0.3, 0.3);
	the_Neon_Device->translate(0, 0.5, 0);

	the_Neon_Device->UpdateWvpMatrix(NULL);

	the_cube->draw(0);

Then my ‘end-view’ calls -

void LS_Display_Compositor::EndView(int view_index, void *graphic_context)
{
#ifdef USING_HOLOPLAY
hp_copyViewToQuilt(view_index);
#endif

return;

}

This is done 32 time with that view_index going from 0 to 31 …

Finally …

void LS_Display_Compositor::EndFrame(int frameindex)
{
if (g_Neon_Device) g_Neon_Device->EndFrame(0);

#ifdef USING_HOLOPLAY
hp_drawLightfield();
#endif

return;

}

I tried to move the Present(1); before to call the hp_drawLightfield(); ( tried also with present(0), no vsynch ) …

Fundamentally … nothing happens … the display just displays the desktop background, it’s like it does not get addressed at all …

What am I missing here ?

I linked with the HoloPlayApi.lib, put the DLL in the correct path … all ‘seems ok’ except the display seems not to give any sign of life.

Suggestions ?

Also I found out that despite the #pragma once and such it appears holoplay.h can be included only one in one source, otherwise it complains all time of ‘duplicated/already defined things’.

Anyway any suggestions to debug what’s going on ??

Cheers.

#4

Ok more, I found out that ‘ok first of all need to find that monitor’, so nothing works unless I do this -

	int count;
	GLFWmonitor** monitors = glfwGetMonitors(&count);
	if (count > 1)
	{
		PRINTF("Monitor name : %s\n", glfwGetMonitorName(monitors[1]));
	}


	// Open a window and create its OpenGL context
	window = glfwCreateWindow(vp.w / sizeDivisor, vp.h / sizeDivisor, "CubeWorld GL", monitors[1], NULL);
	if (window == NULL) {
		fprintf(stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n");
		getchar();
		glfwTerminate();
		return NULL;
	}

On the top of that if I don’t set precisely the resoultion of -

wp.w = 2560;
wp.h = 1600;

The monitor refuses to work.

Finally when I run the code, I get a thing like two views of some cubes translated ( I will upload the pic later ) .

I got like the feeling that hp_copyViewToQuilt(view_index); and hp_drawLightfield(); are doing nothing …

Suggestions ?

#5

Some printf show me this -

	PRINTF("Values : hp_quiltTexture %d, hp_VAO %d, hp_VBO %d\n", hp_quiltTexture, hp_VAO, hp_FBO);

	PRINTF("Values : qs_viewWidth %d, qs_viewHeight %d\n", qs_viewWidth, qs_viewHeight);

Values : hp_quiltTexture 0, hp_VAO 0, hp_VBO 0
Values : qs_viewWidth 0, qs_viewHeight 0

Something is not quite going right here, it’s like the stuff never been correctly initialised ??

#6

Hi all! We’re moving! Instead of having bugs and feature requests be posted on the forum, we’re going to migrate to this GitHub repo . This will make tracking and closing issues much easier for us! Thank you for posting bugs and issues here, I’ll migrate all the content over now.

closed #7