well ok iv written my topic pressed on preview and it told me hey enter a subject and everything was lost… well my fist day… fcuk
however… first… iv learnd english only in school… and dont live in a country where english is the native language… so maybe ill use sometimes words wrong or whatever… just be prepared
i want to write a game… for that wanted to make some kind of layers with different behavior like one layer for particles wich would be heavyly blured… layers cause the background behind the particle layer should be unaffected by the blur
also the backgroudn should shine through the particles if they are translucent through the bluring or a lower alpha value than 0xff
iv tested buffered and volatileImages… though i want much transparency i have to use buffered ones couse (at least on my sytem) v’S dont want to be translucent whatever i do (well saw now that translucents are actualy not implemented)
with -Dsun.java2d.opengl=True the bufferedImages work fast enough… without it seems imposible to write a game with at least 2 fps
btw i create a bufferedImages through: Component.getGraphicsConfiguration().createCompatibleImage(…);
also if i use such a buffered image as a frame buffer to draw into instead of the graphics the paintComponent gets my drawing performance falls down around 100-200 times
as numbers:
just drawing some pictures on the graphics wich i get at paintComponent takes 239416ns
drawing the same into a buffered image takes 57210623 ns!!
and drawing this picture into the graphics in paintComponent takes again 9526071 ns
-> more than 250 times slower
btw vimages are much faster but jet again… cause they have no transparency i cant lay them over each other
drawing the pictures into: 982248
drawing into the Graphics2d i get:3873398
->20 times slower
well my questions:
- how can i make a fast buffer in wich i can draw and manipulate (like blur) image data
also how can i clear it with an alpha chanel of 0xff… didnt figure this out with buffered imagesand creating a new bimg or worse more than one every frame should be imposible
- how can i manipulate this data fast enough…
i dont believe that self written stuff over filters and pixel grabber or ConvolveOp will work fast enough for a game (i would like to make it at least in a size around 800x600)
i thought about a solution in wich i dont have to blur the picture for a particle system… but for that i would have to draw a round gradient instead of a pixel or draw a picture of a round gradient wich i filter through an rgba filter to get the color i want to… and store the new pictures into a hashmap… but in the worst case i would have 2^32 pictures with a sice around 3x3 or 5x5 (100gb data or whatever
also i dont think this would look like a nice interpolation or blur… and with such u could make effects wich use the picture from the frame before do slowly blur out something till u wont see it anymore
the gradient seems to be another problem… cause i dont think creating hundrets of gradient fills with slightly different color values per frame would be much efficient
also i didnt jet figure out how to make round gradients only the ones i can create with GradientPaint
p.s. iv got a little old system (800mhz cpu and some crappy gf2)
however… a game i write should work on my pc shouldnt it?
p.p.s. if someone wants to see my testprogg i can clean it a bit and post it