Bug 753 : implement repeating textures
Last modified: 2008-04-03 21:00




Status:
ASSIGNED
Resolution:
-
Priority:
P4
Severity:
enhancement

 

Reporter:
taifunbrowser
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-04-03 18:49
revision: .135
os: Windows Vista, NVIDEA graphics driver (also tested on Windows XP with
crappy driver)

PGraphics.java
void textureVertex(float u, float v)

For renderers such as OPENGL (and maybe later the pXd), "repeating
textures" are very very useful.

Think of a checkerboard: (Note that the u/v values would be multiplied by
the image dimensions, I've simplified them in this example.)

image(check,0,0,width,height,0,0,14,14); //Would render 14x14 grid!

or even cooler:

image(check,0,0,width,height,0,0,14-(frameCount/40f)%1,14);

^ would render a sliding 14/14 checkerboard. This is very annoying to code,
and its nice if the opengl renderer can do it for us!


Proposed fix:
Remove the offending lines of code. Allow u/v values that exeed image
coordinates, and then throw exceptions in the subclasses of PGraphics if
they don't support it.

Proof of concept:
I did so, re-exported core.jar, and now have a very very nice sliding
checkerboard in OPengl renderer.
Additional Comment #1 From fry 2008-04-03 20:00
marked as feature request.
This bug is now being tracked here.