• What are you working on? v67 - March 2017
    3,527 replies, posted
Damn, GWEN still rocking?
Got texture mapped walls in my raycaster in FreeBASIC. FreeBASIC's fbgfx library doesn't have a way to scale images. What I was doing initially was to just draw each pixel several times to a buffer, so if I wanted to scale a 4x4 image to a 16x16 image, I'd draw each pixel four times to the new buffer. This was, of course, slow as shit. Then I realized "wait, I can just draw a square, so I'm only calling one draw function per source pixel, so to scale a 4x4 image to a 16x16 image, I just need to call the draw square function 16 times. https://files.facepunch.com/forum/upload/132997/069272d5-c31a-4e67-a3e8-eb6626eeb999/2018-04-03_16-36-32.mp4 It gets stuck at the end because of a calculation error, I think. Either the distance is zero, so the height (640/distance) errors out, or the distance is so CLOSE to zero that the line is being drawn infinitely high (or very close to it) and that's causing the program to hang. I'll have to fix that with a number of things. Firstly I can tell it not to draw pixels that are getting cropped out of the window, using a little bit of math.
How do I do collision with walls? Right now what I do is create a "movement" vector. I check collision with the wall, and if there is no collision, then I move to that movement vector. If there is a collision, I don't move. What I want, however, is if I walk against a wall at an angle, to adjust that movement vector so that I walk into the wall and move with the wall. I assume I'd have to get the view angle in relationship to the wall and do something with that?
That's Java in the screenshot there. I wrote an entire JVM implementation in LuaJIT
hahaha oh shit im retarded how embarrassing
i no dad i was a mistake
I Implemented mipmapping since scaling large images is still slow The base image is 256x256 Without mipmapping: https://files.facepunch.com/forum/upload/132997/714d9741-4416-469a-b315-8c6bcbe2cfce/NoMipMap.mp4 With mipmapping https://files.facepunch.com/forum/upload/132997/885e8de1-b9d8-48ba-8910-65ed5e75aed5/2018-04-03_22-43-57.mp4 Still slow when you get up close (since it's rendering the 256x256 in full), so I still need to optimize some of that out
Vector projection is what you're after. Just project your velocity onto a vector that's parallel to the wall and you're good.
You create a vector normal to the wall with an equal magnitude of the collision into the wall, so that when you add that vector to the velocity you cancel out the movement into the wall and it goes along the wall instead. You may want to adjust the magnitude so that you walk at an equal speed as before but care needs to be put so you don't accidentally walk into the wall after adjustments. If you look at Doom you do not get a magnitude adjustment, which imo is more intuitive (but there are also wall running bugs in Doom so ymmv).
I've seen this term "Normal" in regards to vectors before. What does it mean?
Normal is the opposite of irregular.
a normal vector is just a vector that's perpendicular to a surface/line in whatever context
Also there's this wierd idiosyncrasy where a normal vector is (as it should be) a vector that's perpendicular to a surface, but a normalized vector is a vector that has a magnitude of one. Kinda misleading.
After a week of fucking around and dealing with bugs, I've managed to reduce my frametime from ~27 ms to ~19 ms I haven't finished all of my optimizations yet, but so far I've done: made a single buffer that all models share for transform data, removes per-model UBO binding single set of VBO's + 1 VAO for all models to share for per-vertex data, removing per-model VAO binding glMultiDraw can now be used, removing per-model draw call Coupled with my previous work of setting up persistently mapped buffers and experiments with indirect rendering, I can now render my entire scene with 1 draw call using glMultiDrawArraysIndirect
A single drawcall for all your geometry is prime as hell dude, good job! Once we get a look at the GLSL generated from your shader's compiled bytecode, I bet we can track down more issues. If you want to get really fancy, there are still yet even more things you can try I bet! Good work thus far, though. Have you been enjoying this challenge? I'm writing driver code for software-defined radios at work and it's boring as hell, so I'm going to live vicariously through you and by helping you haha
Its fun, but a little bit stressful sometimes. I like keeping my code clean but doing some of these new things can end dirtying up my code a bit. Plus, I get anxious wanting to to apply a new concept i've learned and use it everywhere it applies, sometimes to my detriment by changing too much without cleaning up.
I have the same problem - lately I've been pulled harshly back to reality by the complexity of building a nice renderer. Like my current problem relates to descriptor sets, sharing sets vs recreating sets constantly, and being able to generate the appropriate binding calls at runtime. Its such a complex problem that I don't even know how to express how complex it is or the challenges I'm facing in a succinct manner here. Its been tough, to say the least. And it's only a subset of the challenges I have to figure out to get a decent rendergraph setup, since I'm not including then parsing these resource usages between sets to make sure that I insert the proper memory barriers, command semaphores, or blocking events to avoid modifying a resource while it's in use. its been a bit difficult to even conceptually lay out the framework for, to be honest.
Wait, is Chonks wrong, though? That's my understanding, too. I thought normal vectors are perpendicular vectors and normalized vectors are unit vectors. My understanding is that they're disparate concepts, but normal vectors are, I believe, also usually normalized, as there is no need for them to have magnitude (length).
I think people were disagreeing with the "kinda misleading" bit at the end.
WIP implementation of FizzBuzz in pure(ish) LuaJIT: [Lua] I still have a lot of plans to add static/dynamic code analysis for speeding up the compiled output (namely, removing stack as a table).
Made image scaling WAY faster. So now I've got mipmapping AND directly scaling usign RGB data rather than drawing lines. Here's a demo, you can watch it fly https://files.facepunch.com/forum/upload/132997/f2b2d415-2770-4772-85e1-449a87e8d1ce/2018-04-04_22-44-32.mp4
IT ALREADY EXISTS! https://github.com/kpalosaa/gwen-net-ex Fucks sake. Oh well, this is faster, even if I wasted a day.
oh thank god the winner and dumb ratings are back
I'm currently working on writing a secure bootloader for the Zedboard in Rust for my bachelor thesis. So far I'm still coding the encryption in desktop Rust and working on getting C and Rust to play nicely in both directions. Because the next step will be to try to get a Rust binary to run baremetal on the board. And then I'll talk to my advisors about actually starting work on the bootloader portion of the project. So far I'm really happy with Rust. All my life I've mostly used languages like Kotlin, C# and Java and only used C/C++ for university assignments. While Rust is still a very low level language like C, it's so much less stressful to use because of all the safety features that stop you from doing stupid shit. Also, because I'm having nothing but trouble with virtual machines and don't want to dual boot Linux on my gaming desktop I've finally tried out WSL. I could not be happier about it. Everything I've tried so far works absolutely flawlessly. I installed Cygwin's X server and can even use GUI prorams like my IDEs. Performance is basically on par with native Windows programs and the GUIs work and look exactly how they should.
No-one could figure out the controls, so I had to add some help https://files.facepunch.com/garry/1064814f-d0ff-46d7-bc55-5f1b3f6e5831.mp4
Lois Griffin, is that you?
porting va/grid to love 11 because fuck me ill have to do it at some point https://i.imgur.com/PQkXAAJ.png grid will have 11.0 support this weekend, and lgf's love support has been updated to serve as a 11.0 drop-in replacement, too i also drew up the starting bedroom for va, which was what I wanted to work on tonight until I got fucked by this shit pokemon red and a link to the past are inspirations for va, and in both games, you also start in your home so I guess that makes sense
Did you ever finish your UI? Visibility feature is coming along, still has some tweaking left to do. The front of that wall probably shouldn't be visible. https://files.facepunch.com/forum/upload/110080/8343002d-226a-43d4-9496-557e51f0a878/image.png I got Gwen up and running too, but that was easy and it's ugly so I didn't screenshot it.
Yeah, GUI is done. I'm working on tileset artwork and sound design at the moment. There are only two good ways to do GUI design in 2018. Win32-style with invalidation rects, or HTML-based. I'm adding the latter to Grid 8 because the former is just too time consuming, and I wouldn't recommend it to anyone unless you prioritized performance over everything else.
i wrote a CSS engine in C++ to try and replicate valve's panorama, but I never got around to finishing it. maybe one day.
Sorry, you need to Log In to post a reply to this thread.