|
Author |
Topic: blend(), texture(), alpha() suggestions (Read 436 times) |
|
mm Guest
|
blend(), texture(), alpha() suggestions
« on: Mar 21st, 2004, 2:41am » |
|
ok i feel that blend() texture() and alpha() need rethought because it is impossible to blend two images before they hit the visible screen. it is also impossible to do an alpha'd texture. it would be nice to be able to blend two images and then apply them as a texture. or three images. without ever routing them to the display it would also be nice to be able to display two textured polygons on top of each other with an alpha blend it would also be nice to reroute display data to a seperate int tempBuffer[height*width] so that you could prepare each frame before displaying them. something like active(screen); active(myBuffer); with it defaulted to screen unless active() is called or maybe instead of active, call it display(), page() .. something to this effect.. where myBuffer is of type BImage it would be nice if blend returned an image newImage = blend(imgA,imgB,50); it would be nice if this code worked: Code: BImage genImg( int resx, int resy ) { BImage B = new BImage(resx,resy); int i, x, y, xOffset, yOffset; color tempColor; float shading; int[] newBuffer = new int[width * height]; int r,g,b; r=(int) noise(255); g=(int) noise(255); b=(int) noise(255); B.width=resx; B.height=resy; B.format=RGB; for (i = 0; i < (resx * resy); i ++) { x = i % resy; y = int(floor(i / resy)); if ((x > 0) && (x < (resx - 1)) && (y > 0) && (y < (resy - 1))) { xOffset = newBuffer[i - 1] - newBuffer[i + 1]; yOffset = newBuffer[i - resx] - newBuffer[i + resx]; shading = 0;//xOffset; tempColor = color(r) - shading, color(g) - shading, color(b) - shading); B.pixels[i] = tempColor; } } return B; } |
| some thoughts
|
|
|
|
|