OpenGL shaders?

I am writing a game in Java, LJGWL (OpenGL). I use a library that handles a lot of messy details for me, but I need to find a much faster way to do this.

Basically, I want to set every pixel on the screen to say random color as quickly as possible. "Random colors" is just an array [] [], which is updated every 2-3 seconds. I tried drawing rectangles and using images, both pretty slow for what I want to do.

I think I want to learn how to write a graphic shader? Is this the fastest way to do this? LJGWL provides OpenGL api for java. Any basic guides for getting started with OpenGL shaders? Or should I dynamically create some kind of texture and then just throw away the whole texture, will it be faster?

+3
source share
4 answers

, . , . GRAM, , CPU GPU. , , Pixel Frame Buffer Object. / GRAM DMA ( CPU), .

, - . SongHo OpenGL - , Buffer Objects. ( ++, )

+6

- - , , , . , glTexSubimage2D, .

.

+2

OpenGL, , , .

0

, , , , - , (?). , 2-3 , . , , ...

?

  • ? ? , ,...?
  • ? ? , ?
  • How fast can I get 1920x1080 (?) Pixels in video memory, what is your hardware, drivers, OS?

I think you need to edit / postpone before we can help you solve your problem. Just because it's slow is not a guarantee that shaders will even be one bit faster.

0
source

Source: https://habr.com/ru/post/1767247/


All Articles