VoidExpanse > Ideas and suggestions

Virtual Reality for Void Expanse! Custom Oculus Touch Mapping!

(1/4) > >>

Here's the Google Drive link to a video of the project! It took me 1 month and a half to code a lot of stuff Inside of the program. I am using the AB4D DXEngine Oculus Wrap and the Ab4D Oculus sample and the SharpDX libraries! The video is 500mb long approx 26min. Sorry for the bad language in the video if there is any.

Enjoy watching.



This looks quite cool actually, but I imagine it doesn't really add anything to the game, or does it? :)
But either way, awesome!


--- Quote from: Lurler on July 15, 2018, 10:00:46 pm ---This looks quite cool actually, but I imagine it doesn't really add anything to the game, or does it? :)
But either way, awesome!

--- End quote ---

Thank you Lurler  ;D

No, it doesn't change the gameplay and it probably never will.

BUT, I am onto something there, that might be a way to change the appearance of the background if the background's color is constant in ARGB. I did some tests with a constant background color, but unfortunately for the moment, the performance is not high enough and my processor cannot handle dealing with  8 294 400  bytes every frames (which is 1920p multiplied by 1080p multiplied by 4 because every pixel in the screen is 4 bytes), in fact, it could only deal with 1/4 of the screen pixels and NOT every frames and so it was useless and ugly to look at for the moment. Basically, I can loop through the bytes array that contain the image to find the bytes that correspond to the "Constant Color" and then change the colors programatically. My goal was to make the color with an alpha value of 0 (i think 0 is for transparent) so that I can add a 3d background. I will need to work more on this though, as I can't promise it will ever work.

Void Expanse already has a 3d background and although we can see the effects, it still remains a 2d image that we look at. But If I make the background invisible in Virtual Reality, I can put ANYTHING at ANY depth behind the Virtual Screen that won't Interact with the game Itself. It would just make the game very beautiful to Watch in Virtual reality with a "real" 3d background.

Also, I "might" just be able to fiddle a little bit with a "mesh" and change the depth of the vertices of the mesh to match "ships" and "stations" in the game. BUT that, I didn't try it yet because I am working this week and I am K.O. when I arrive home  ;)

Just wanted to clarify that it never is going to change the gameplay... Only the background visual and maybe foreground. I am not into "hacking" void expanse ;). I succeeded in making the background completely transparent in virtual reality so we see only "decorations/objects/ships/stations" but I am somewhat lacking knowledge in speeding things up with c# pointers. I am working on that right now... I just wish to be able to do another tutorial this weekend but I am caught up in making this work.

I am trying MemoryStreams and Pointers (which I have a big gap knowledge in accessing bytes per bytes for MemoryStreams)... Right now I am at 2 milliseconds overhead in just making the player area transparent. I can't seem to bring it down to 0 but at 1920*1080 it still is 736000 bytes to check every frames for the player ship area that starts at 720 in the X and 360 in the Y coordinates.

I have been 1 week on this junk and I am starting to lose confidence.

By the way, if any Void Expanse players have an Oculus Rift, please write here. I'd love to know how many we are.

Here's a code snippet that I can't make any better for the moment.

--- Code: ---  fixed (byte* textureByteArray = _textureByteArray, previousTextureByteArray = _previousTextureByteArray, currentByteArray = _currentByteArray)
                byte* buffer0;
                byte* buffer1;
                byte* buffer2;

                for (int x = xxPlayerShip; x < xxPlayerShip + widthOfRectanglePlayerShip; x++)
                    for (int y = yyPlayerShip; y < yyPlayerShip + (heightOfRectanglePlayerShip); y++)
                        bytePos = ((y * 1920) + x) * 4;

                        buffer0 = &textureByteArray[bytePos + 0];
                        buffer1 = &textureByteArray[bytePos + 1];
                        buffer2 = &textureByteArray[bytePos + 2];

                        if (*buffer0 + *buffer1 + *buffer1 >= 750)
                            byte* buffer00 = &currentByteArray[bytePos + 0];
                            byte* buffer11 = &currentByteArray[bytePos + 1];
                            byte* buffer22 = &currentByteArray[bytePos + 2];
                            byte* buffer33 = &currentByteArray[bytePos + 2];

                            *buffer00 = 0;
                            *buffer11 = 0;
                            *buffer22 = 0;
                            *buffer33 = 0;

--- End code ---

usually any stuff which is dealing with framebuffer data should operate as a GPU shader, otherwise you're forcing GPU to flush all the graphics command to access the framebuffer data, then modify it and push back. No wonder it's ultra expensive.

With a GPU shader - you can call it a GPU post-processing shader - you can perform the same operation per pixel very effectively. And the code of such shader will be super simple as you basically need only the framebuffer for input and a very short pixel shader to modify the color of each pixel.

Unfortunately, I don't have any knowledge of how you can hook into the graphics API with Oculus, but there are should be definitely a pretty simple way - as you're already doing something very similar, but in a different way (by copying the framebuffer from GPU to RAM and modifying it with CPU, and then pushing it back to GPU).



[0] Message Index

[#] Next page

Go to full version