Forum Discussion
vhv-developer
7 years agoExplorer
Faulty Documentation: Misleading Comment and Pointless Settings in Layer Code
In the current documentation there are the following lines of code:
// Display all of the HUD texture.
hudLayer.Viewport.Pos.x = 0.0f;
hudLayer.Viewport.Pos.y = 0.0f;
hudLayer.Viewport.Size.w = 1.0f;
hudLayer.Viewport.Size.h = 1.0f;The comment gave me the impression, that some kind of UV mapping is done here. I wanted to view all of my texture, too. So this seems correct. After spending much painful time, I realized that the size is supposed to be the pixels and that's not a UV mapping. The corrected lines should be like this:
ID3D11Texture2D* tex = nullptr;
ovr_GetTextureSwapChainBufferDX(Session, TheHudTextureSwapChain, 0, IID_PPV_ARGS(&tex));
D3D11_TEXTURE2D_DESC desc;
tex->GetDesc(&desc);
// Display all of the HUD texture.
hudLayer.Viewport.Pos.x = 0.0f;
hudLayer.Viewport.Pos.y = 0.0f;
hudLayer.Viewport.Size.w = desc.Width;
hudLayer.Viewport.Size.h = desc.Height;Or you correct the comment:
// Displays only the first pixel of the HUD texture:
hudLayer.Viewport.Pos.x = 0.0f;
hudLayer.Viewport.Pos.y = 0.0f;
hudLayer.Viewport.Size.w = 1.0f;
hudLayer.Viewport.Size.h = 1.0f;The sample "Direct Quad" did it right, but there are developers who actually read the documentation... I would like to end with a citation of another user: "just a bit frustrating seeing a 2 billion $ funding not being able to test the very simplest of Documentation leading to developers sometimes loosing weeks"3 Replies
- thewhiteambitAdventurer++ same here [sounds a little bit like my rant]. Each time I touch the API it ends in reverse engineering and answers from the team seem to take months. Time that I better use writing my own replacement code of render layers for example, since the layer rendering is completely f***ed up in so many ways (for example there is also a very strange height shift dependent on the first sensor, so the layers given rendering position is shifted, this is all so frustrating, documentation on depth-buffers is also contradictory, it is a bit as if the SDK is rarely ever used and their focus is only on Unity 3D hobbyists. They even shipped broken VS Projects for years that forced the whole Solution to completely recompile because some files in their Projects were missing but not needed at all. I think some might still be broken, had to fix the projects with each SDK update). I had to find out about the UV mapping assumption the hard way like you to! I even stopped mentioning here what I found out, since it is hardly ever corrected when reported. But hey, lets create another home screen environment for hundred thousands of $$... because that's what the user really wants!!!!!! Who cares about a lack of software because hundreds of developers waste days and weeks and days. Each developer on its own reverse engineering their bad documentation again and again and again. These developers are not on the Oculus payroll - so who cares? Really, who makes such bad management decisions and later wonders why VR is failing right now?
- vhv-developerExplorerThanks for the 'uplifting' words! :wink: And sorry for not mentioning your name when quoting. It really was you. The words stuck in my head and that's why I posted the error here, because I don't want to let others fall into that trap. Assuming you are doing Oculus development for a while now, I'll consider your words carefully but I hope I don't turn to the dark side, as you did. :p
My impression is similar, that most of the Oculus development is done through Unity or Unreal engine.The PC development being the largest group in the forums can then only be explained by the lack of good documentation and self-explaining examples... >:) - thewhiteambitAdventurerWhenever a individual struggles and I stumble upon it I still try to help. But I am a bit tired of reporting bugs and never see them fixed. It's not the dark side, it is the resigned side - that's even worse ;)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device