Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - AGP

#1
Support / Re: Is there any magic to compile(true)?
April 06, 2025, 09:25:41 AM
To elaborate, I get a List<Channel> for the entire animation set from my importer. But without knowing what's what, I don't know how to create the individual clips of the different animations.
#2
Support / Re: Is there any magic to compile(true)?
April 05, 2025, 09:04:39 AM
I will make a minimalist demo. Would you also help me parse the animations? Because that's basically the one thing that I haven't yet added to the glb thing. At some point I'll go back to the cloth simulation, too. I want to have all of these toys in jpct.
#3
Support / Re: Is there any magic to compile(true)?
March 05, 2025, 09:31:30 AM
GenericVertexController. Is there another way? Anyway, what values should I plug in for compile()?
#4
Support / Re: Is there any magic to compile(true)?
February 26, 2025, 08:46:00 PM
I just tried, since I don't know what to put in for batchSize, the following. Still breaks the animation.

obj.compile(true, true, true, false, -1);
#5
Support / Re: Software Render Color Depth
February 26, 2025, 02:38:36 AM
Now I want the same code to also work with OpenGL. But I'm getting:
QuoteException in thread "main" java.lang.NullPointerException: Cannot read the array length because "this.texels" is null
#6
Support / Is there any magic to compile(true)?
February 24, 2025, 08:52:34 PM
I can do compile(true) and not lose animations on Raft's bones. But it breaks the animations on my GLB models with my own bone structure. Is there anything that I should be overriding and adding? If not, would you have a clue as to what's doing this?
#7
Support / Re: Software Render Color Depth
February 16, 2025, 09:52:21 PM
Thanks a lot. It is unnecessarily complicated, though, isn't it?
#8
Support / Re: Software Render Color Depth
February 12, 2025, 07:21:56 AM
I tried texture.setAlpha(). Even tried replacing the texture in the texture manager. It doesn't change the object's opacity in any way.
#9
Support / Re: Software Render Color Depth
February 09, 2025, 08:47:48 PM
So is there no way to do a proper fadeout?
#10
Support / Re: Software Render Color Depth
February 08, 2025, 10:06:59 PM
I thought that it was a color thing that nothing I do makes an object fade in or out with the software render. This is a basic test I wrote (several different attempts in there, none of which work):


import java.awt.*;
import java.awt.event.*;
import com.threed.jpct.*;

public class Transparency extends Frame implements WindowListener {
    private World theWorld;
    private FrameBuffer buffer;
    private Camera cam;
    private Object3D obj;
    private boolean keepGoing, turnRight, turnLeft;
    private com.threed.jpct.util.KeyMapper keyMapper;
    private Texture boxMap;
    private int transparency = 0;
    private FadeoutEffect effect;

    public Transparency() {
       this.setTitle("BR's");
       theWorld = new World();
       buffer = new FrameBuffer(1440, 900, FrameBuffer.SAMPLINGMODE_NORMAL);
       obj = com.threed.jpct.util.ExtendedPrimitives.createBox(new SimpleVector(2f, 2f, 2f));//Primitives.getCube(1f);
       TextureManager.getInstance().addTexture("boxMap", (boxMap=new Texture("BoxMap.png", true)));
       boxMap.setEffect((effect=new FadeoutEffect()));
       obj.setTexture("boxMap");
       obj.build();
       obj.setTransparencyMode(Object3D.TRANSPARENCY_MODE_DEFAULT);
       obj.setTransparency(transparency);
       Object3D backgroundPlane = Primitives.getPlane(1, 4f);
       backgroundPlane.build();
       backgroundPlane.translate(0f, -2f, 0f);
       theWorld.addObject(backgroundPlane);
       cam = theWorld.getCamera();
       cam.moveCamera(Camera.CAMERA_MOVEOUT, 8f);
       theWorld.addObject(obj);
       obj.setLighting( Object3D.LIGHTING_NO_LIGHTS );
       keyMapper = new com.threed.jpct.util.KeyMapper(this);
       this.addWindowListener(this);
       this.setSize(buffer.getWidth(), buffer.getHeight());
       this.setVisible(true);
       loop();
    }

    public void loop() {
       keepGoing = true;
       while (keepGoing) {
           buffer.clear();
           com.threed.jpct.util.KeyState keyState = keyMapper.poll();
           if (keyState.getState() == com.threed.jpct.util.KeyState.PRESSED)
              keyPressed(keyState.getKeyCode());
           else if (keyState.getState() == com.threed.jpct.util.KeyState.RELEASED)
              keyReleased(keyState.getKeyCode());
           if (turnRight)
              obj.rotateY(-.01f);
           if (turnLeft)
              obj.rotateY(.01f);
           theWorld.renderScene(buffer);
           theWorld.draw(buffer);
           //theWorld.drawWireframe(buffer, Color.yellow);
           buffer.display(this.getGraphics());
           Thread.yield();
       }
       buffer.dispose();
       this.dispose();
       System.exit(0);
    }

    private void keyPressed(int keyCode) {
       if (keyCode == KeyEvent.VK_RIGHT)
           turnRight = true;
       if (keyCode == KeyEvent.VK_LEFT)
           turnLeft = true;
    }
    private void keyReleased(int keyCode) {
       if (keyCode == KeyEvent.VK_RIGHT)
           turnRight = false;
       if (keyCode == KeyEvent.VK_LEFT)
           turnLeft = false;
       if (keyCode == KeyEvent.VK_T) {
           float fade = 1.00f;
           if (transparency < 255)
              fade = (float)((transparency+=8)/255f);
           effect.transparency = 255-transparency;
           obj.setTransparency(255-transparency);
           //boxMap.setAlpha(255-transparency);
           TextureManager.getInstance().replaceTexture("boxMap", boxMap);
           //obj.setAdditionalColor(intensity(boxColor, fade));
           //boxMap.applyEffect();
           Logger.log("Transparency: "+transparency, Logger.MESSAGE);
       }
    }
    public void windowClosing(WindowEvent e) {
       keepGoing = false;
    }
    public void windowClosed(WindowEvent e) {}
    public void windowOpened(WindowEvent e) {}
    public void windowActivated(WindowEvent e) {}
    public void windowDeactivated(WindowEvent e) {}
    public void windowIconified(WindowEvent e) {}
    public void windowDeiconified(WindowEvent e) {}

    public static void main(String[] args) {
       new Transparency();
    }
}
class FadeoutEffect implements ITextureEffect {
    public int transparency;
    private Texture tex;
    public FadeoutEffect() {
    }

    public void init(Texture texture) {
       this.tex = texture;
    }

    public void apply(int[] dest, int[] src) {
       /*for (int y =0; y < 512;y++) {
              for (int x = 0; x < 512; x++) {
                     dest[y*x] = transparency;
              }
       }*/
       tex.setAlpha(transparency);
    }

    public boolean containsAlpha() {
       return false;
    }
}
#11
Support / Software Render Color Depth
February 07, 2025, 11:08:25 PM
If I'm not mistaken, the software renderer works with 16 bits for color (and a third byte for transparency?). Is it trivial giving it all 24 bits (plus a byte for transparency). If so, would you?
#12
News / Re: Forum upgraded to 2.1.4
January 31, 2025, 09:52:55 PM
Please try to search for a topic. It doesn't fail sometimes, it fails every time.
#13
News / Re: Forum upgraded to 2.1.4
January 28, 2025, 09:00:20 PM
I've tested it with Edge, just in case. Same: "Database error. Please try again. If you come back to this error screen, report the error to an administrator."
#14
Support / Re: Caching Animations in Software Rendering
January 28, 2025, 08:54:26 PM
When the program is already running, each animation cycle gets progressively faster. It's probably not noticeable on the OpenGL renderer only because the hardware rendering already starts fast. Is there no way around this apart from delaying the execution, then?
#15
Support / Caching Animations in Software Rendering
January 22, 2025, 02:19:16 AM
Is that something you can make the software renderer do? Because otherwise jpct goes through several loops of the animations before they're running at full speed.