flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 Next |
Author |
|
gens 16 Nov 2013, 16:28
havent gotten to multitexturing yet, so i cant give you an example on that
thing with opengl is that there is old opengl and there is modern opengl in modern you would probably use glActiveTexture to set it up http://www.opengl.org/sdk/docs/man3/ i am speaking about 3.3 core that is what i picked to learn you can use calls from any version with any version from what i got so far modern works kinda like this: the driver is a state machine it keeps track of all the vertices, pixels and shaders like when you make a buffer using glGenBuffers it returns to you a handle (more like an ID) you say you want to use that thing in later calls by making it current, by binding it then when you fill it using glBufferData, that handle points to that data internally note that it dosent care what is in the buffer, and you can use that data in shaders as you wish the driver also keeps track in what memory that data is it also compiles shaders as programs for the gpu to execute then when tell it to actually draw something it starts the current active program on the gpu (glUseProgram) modern shader based gpus are basically a bunch of compute units (they call em shaders in opegl context, or whatever) so ye its a bunch of math processors grouped together in packs so they can share some cache memory http://www.stanford.edu/~yifanz/images/research/GPUarchitecture_large.png that is the compute part, there are couple parts to process vertices before it kinda like http://www.techarp.com/article/NVIDIA/GeForce_8800_TR/8800_architecture.jpg i remember reading a pdf from nvidia about the 8800 ofc it was full of catchphrases but it did give an overview so it may be worth finding it online i think texture units are still on a special part of a gpu, but i might be wrong (why would they still recommend n^2 texture sizes if it was using main memory, idk) i found this also, intel 4k overview http://www.ozone3d.net/public/jegx/201204/intel-ivy-bridge-hd4000-diagram-architecture.jpg also some in depth http://people.freedesktop.org/~marcheu/linuxgraphicsdrivers.pdf (chapter 8 is about opengl) so shaders are basically compute kernels for massively parallel execution and you should look at them as just parallel data processors, not dedicated 3D processors ofc opengl makes it easier to use them for 3D to 2D processing bdw shaders dont know what you call the buffers you send them http://pastebin.com/Qf4gfiuD heres the small program i patched up it uses the shaders from last post, named " fragmentshader.frag " and " vertexshader.vert " and they have to be in the same directory as the program (had trouble embedding normal text in C) fun thing is you can change the shader without recompiling the program itself if you run windows you need to change usleep() to sleep(10) and maybe clock_gettime() (or just delete it, its to calculate fps) if i remember GLFW can handle timings too, but i like clock_gettime since its a VDSO in linux glibc compile with CC -lGL -lglfw -lSOIL needs soil for loading pictures to RGB and GLFW 3 for everything else GLFW has excellent documentation and can do lots of things |
|||
![]() |
|
tthsqe 19 Nov 2013, 00:23
randall,
thanks for the multitexturing sample. We can assume that GL_TEXTURE0 is active by default? I wanted to try some bump mapping in a hex game (different thread), but it looks like I will only need one texture since the actually look of the pieces is computed by the uv coordinates of the triangle. I just uploaded a tuned version of this game that I think looks the best. It does a small radius gaussian blur followed by a large radius gassian blur on each of the two layers, and each layers is render at 4 times its display resolution. I get about 1000fps (the top number in the lower left) on a gtx 850, However, I noticed that once the frame buffers hit a certain size, the performance on a i5-3320 with integrated graphics takes a huge hit. |
|||
![]() |
|
randall 19 Nov 2013, 07:00
Yes, GL_TEXTURE0 is active by default (this is required by the OpenGL specification).
|
|||
![]() |
|
KevinN 09 Feb 2014, 00:07
getting out of memory error compiling it. looks cool, hope to learn something from it and perhaps become more valuable!
|
|||
![]() |
|
tthsqe 09 Feb 2014, 01:04
In the options>compiler setup you will have to increase the memory.
Let me know if it works for you. I didn't optimize either of the two Gaussian blurs, so if your graphics card can't handle the resolution, try changing as Code: WINDOW_WIDTH fix 600 WINDOW_HEIGHT fix 400 WINDOW_WIDTH_FP fix '600.0' WINDOW_HEIGHT_FP fix '400.0' Also, the particles and grid background require quite a bit a processing, so it is triple threaded. |
|||
![]() |
|
KevinN 09 Feb 2014, 01:35
You know, I just upgraded to latest FASM and compiled it with no problem. Not sure if replacing the old fasm version with this new one adjusted memory size. I forgot about that option though. Thanks for reminding me.
|
|||
![]() |
|
sid123 11 Feb 2014, 12:10
Wh.....a..t..? Seems I have to learn a lot. I'm way behind I guess.
This looks amazing! Better than GTA 5 ![]() Fanboys what asm can achieve. ![]() I will try it when I'm home. i3-2370M, 64 bit, 8 GB RAM,Intel HD 9000, nVIDIA GT400. Should that be enough? |
|||
![]() |
|
tthsqe 11 Feb 2014, 13:46
I would like to clean up the code a bit, possibly optimize the graphics, and know where it crashed. Kevin, could you tell me where it crashed for you?
|
|||
![]() |
|
KevinN 11 Feb 2014, 19:04
tthsqe wrote: Kevin, could you tell me where it crashed for you? One exe was crashing when I tried to launch/run it with fasm. Not sure what was up. I deleted it and reassembled and now there is no problem like that. |
|||
![]() |
|
m3ntal 11 Feb 2014, 23:17
tthsqe: One of the best game examples written in FASM. It works on my roomates PC, but it crashes on my PCs (laptop+itx) on Win7 32BIT. On startup, "C000001Dh: Illegal instruction" (just from this, I would suspect that esp became unbalanced or eip didn't return correctly or some jmp [table+ecx*4]).
|
|||
![]() |
|
LocoDelAssembly 11 Feb 2014, 23:43
Wow, this is a super mega example! I'd say it would be better categorized as a whole project rather than example.
m3ntal, maybe your computers don't support SSE4.1? Check with CPU-Z. Or run this program and make sure it terminates without crashing: Code: format pe gui 4.0 mpsadbw xmm0, xmm0, 0 ret |
|||
![]() |
|
m3ntal 11 Feb 2014, 23:56
Loco: That was it! My CPU doesn't support SSE4.1. VC6 debugger displayed exactly the same error and address.
|
|||
![]() |
|
tthsqe 12 Feb 2014, 01:00
ok - I am in the process of cleaning up the code. It really does not need sse 4.1 dpps, so am I definitely replacing it. I'm also trying to speed up the graphics, as I am getting very poor results even on haswell GPU. Of course, gtx 580 just plows through it, but this is probably because they have a better driver.
|
|||
![]() |
|
HaHaAnonymous 12 Feb 2014, 01:06
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 18:14; edited 1 time in total |
|||
![]() |
|
catafest 17 Feb 2014, 22:15
... about SSE 4.1 you can find something useful here :
http://software.intel.com/sites/default/files/m/a/9/b/7/b/1000-SSE.pdf and I have a question about your source code : what is and where can be found : call GLCleanup and this invoke GetClientRect,[hwnd],rc !! tthsqe wrote: ok - I am in the process of cleaning up the code. It really does not need sse 4.1 dpps, so am I definitely replacing it. I'm also trying to speed up the graphics, as I am getting very poor results even on haswell GPU. Of course, gtx 580 just plows through it, but this is probably because they have a better driver. |
|||
![]() |
|
tthsqe 18 Feb 2014, 02:46
call GLCleanup: misc.inc line 380
invoke GetClientRect,[hwnd],rc: I don't think I use this. Instead I have CorrectMainWindowSize: misc.inc line 879 Now that I look back at the cleanup function, I think I am missing some frame buffers and the shader programs. I;ll have to add clean up code for those as well. |
|||
![]() |
|
catafest 18 Feb 2014, 10:01
I take a look ... also why don't use glFlush and OpenGL.GL.ARB
Maybe one video tutorial about how you codding this into real time will help, the code seam clear , just is to big ![]() tthsqe wrote: call GLCleanup: misc.inc line 380 |
|||
![]() |
|
catafest 20 Feb 2014, 13:27
@tthsqe : take a look at olly , can help you ...
|
|||
![]() |
|
tthsqe 20 Feb 2014, 23:52
@catafest: With what can ollydbg help me? Things seem to be working fine in this example, except that I might not be cleaning everything at the end.
|
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.