public LwjglPbufferTextureRenderer(final DisplaySettings settings, final Renderer parentRenderer, final ContextCapabilities caps) { super(settings, parentRenderer, caps); int pTarget = RenderTexture.RENDER_TEXTURE_2D; if (!MathUtils.isPowerOfTwo(_width) || !MathUtils.isPowerOfTwo(_height)) { pTarget = RenderTexture.RENDER_TEXTURE_RECTANGLE; } // signature: boolean useRGB, boolean useRGBA, boolean useDepth, boolean isRectangle, int target, int mipmaps _texture = new RenderTexture(false, true, true, pTarget == RenderTexture.RENDER_TEXTURE_RECTANGLE, pTarget, 0); setMultipleTargets(false); }
/** * Constructor builds a new heightmap using the midpoint displacement algorithm. Roughness determines how chaotic * the terrain will be. Where 1 is perfectly self-similar, > 1 early iterations have a disproportionately large * effect creating smooth terrain, and < 1 late iteraions have a disproportionately large effect creating chaotic * terrain. * * @param size * the size of the terrain, must be a power of 2. * @param roughness * how chaotic to make the terrain. * * @throws Ardor3dException * if size is less than or equal to zero or roughtness is less than 0. */ public MidPointHeightMapGenerator(final int size, final float roughness) { if (!MathUtils.isPowerOfTwo(size)) { throw new Ardor3dException("Size must be (2^N) sized."); } if (roughness < 0 || size <= 0) { throw new Ardor3dException("size and roughness must be " + "greater than 0"); } this.roughness = roughness; this.size = size; }
/** * Constructor builds a new heightmap using the midpoint displacement algorithm. Roughness determines how chaotic * the terrain will be. Where 1 is perfectly self-similar, > 1 early iterations have a disproportionately large * effect creating smooth terrain, and < 1 late iteraions have a disproportionately large effect creating chaotic * terrain. * * @param size * the size of the terrain, must be a power of 2. * @param roughness * how chaotic to make the terrain. * * @throws Ardor3dException * if size is less than or equal to zero or roughtness is less than 0. */ public MidPointHeightMapGenerator(final int size, final float roughness) { if (!MathUtils.isPowerOfTwo(size)) { throw new Ardor3dException("Size must be (2^N) sized."); } if (roughness < 0 || size <= 0) { throw new Ardor3dException("size and roughness must be " + "greater than 0"); } this.roughness = roughness; this.size = size; }
throw new Exception("levelIndex must be positive"); if (!MathUtils.isPowerOfTwo(clipSideSize + 1)) { throw new Exception("clipSideSize must be one less than power of two");
throw new Exception("levelIndex must be positive"); if (!MathUtils.isPowerOfTwo(clipSideSize + 1)) { throw new Exception("clipSideSize must be one less than power of two");
if (!MathUtils.isPowerOfTwo(size)) { throw new Ardor3dException("size must be power of two!");
if (!MathUtils.isPowerOfTwo(size)) { throw new Ardor3dException("size must be power of two!");
if (ardorImage.getWidth() != ardorImage.getHeight() || !MathUtils.isPowerOfTwo(ardorImage.getWidth())) { throw new IllegalArgumentException("Only pow2, square images are supported.");
if (ardorImage.getWidth() != ardorImage.getHeight() || !MathUtils.isPowerOfTwo(ardorImage.getWidth())) { throw new IllegalArgumentException("Only pow2, square images are supported.");
if (!MathUtils.isPowerOfTwo(width)) { int newWidth = 2; do { if (!MathUtils.isPowerOfTwo(height)) { int newHeight = 2; do {
if (!MathUtils.isPowerOfTwo(w)) { int newWidth = 2; do { if (!MathUtils.isPowerOfTwo(h)) { int newHeight = 2; do {
if (!MathUtils.isPowerOfTwo(width)) { int newWidth = 2; do { if (!MathUtils.isPowerOfTwo(height)) { int newHeight = 2; do {
if (!MathUtils.isPowerOfTwo(width)) { int newWidth = 2; do { if (!MathUtils.isPowerOfTwo(height)) { int newHeight = 2; do {
&& (!MathUtils.isPowerOfTwo(image.getWidth()) || !MathUtils.isPowerOfTwo(image.getHeight())); if (actualWidth > maxSize || actualHeight > maxSize || needsPowerOfTwo) { if (needsPowerOfTwo) {
&& (!MathUtils.isPowerOfTwo(image.getWidth()) || !MathUtils.isPowerOfTwo(image.getHeight())); if (actualWidth > maxSize || actualHeight > maxSize || needsPowerOfTwo) { if (needsPowerOfTwo) {