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.


Messages - AGP

Pages: [1] 2 3 ... 104
1
Support / Re: Environment Mapping with Software
« on: February 13, 2018, 05:26:53 am »
I'll send it to you as soon as possible, via email.

Would you as least show me how I could do Polyline so that my lines would take the depth buffer in consideration (as it stands, my little hack gets drawn over everything)?

2
Support / Re: Environment Mapping with Software
« on: February 09, 2018, 07:09:40 pm »
So I wrote prepareForSoftware() as follows. Trouble is I'm sensing that the order of the operations is wrong. It's currently going:

Code: [Select]
texInfo = new TextureInfo(tm.getTextureID("EnvironmentMap"));
texInfo.add(tm.getTextureID("Starfighter.png"), TextureInfo.MODE_ADD_SIGNED); //MODE_ADD, MODE_BLEND, MODE_MODULATE, MODE_ADD_SIGNED
in the constructor. Then, once it's been established that the renderer in use is software:

Code: [Select]
     public void prepareForSoftware() {
TextureManager.getInstance().addTexture("GreyBump", new  Texture(1024, 1024, new java.awt.Color(128, 128, 128)));
body.setBlending(true);
texInfo.add(TextureManager.getInstance().getTextureID("Starfighter.png"), TextureInfo.MODE_ADD_SIGNED);
texInfo.add(TextureManager.getInstance().getTextureID("GreyBump"), TextureInfo.MODE_ADD_SIGNED);
     }

No go. On the other hand:

Code: [Select]
     public void prepareForSoftware() {
TextureManager.getInstance().addTexture("GreyBump", new  Texture(1024, 1024, new java.awt.Color(128, 128, 128)));
body.setBlending(true);
texInfo = new TextureInfo(TextureManager.getInstance().getTextureID("Starfighter.png"));
texInfo.add(TextureManager.getInstance().getTextureID("EnvironmentMap"), TextureInfo.MODE_ADD_SIGNED);
texInfo.add(TextureManager.getInstance().getTextureID("GreyBump"), TextureInfo.MODE_ADD_SIGNED);
body.setTexture(texInfo);
     }
produces a very similar effect to my combineAmbientAndDiffuse() method (the diffuse information is not in the right place but the environment map, tinted by the diffuse color, behaves right).

3
Support / Re: Environment Mapping with Software
« on: February 09, 2018, 04:00:40 pm »
I'll try the setBlending thing and report back.

Why not? Academically, you have to agree that there should be no difference between what each renderer can render.

4
Support / Re: Environment Mapping with Software
« on: February 09, 2018, 01:30:59 am »
Do you have a response?

Also, I know I keep hitting the same keystrokes but, Polyline for the software renderer? It's really very important. I wrote the following class. Even if it worked all of the time, it would still be a bit of a hack...

Code: [Select]
import java.awt.*;
import com.threed.jpct.*;

public class PolylineSoft extends Polyline {
     private SimpleVector[] points;
     public PolylineSoft(SimpleVector[] points, java.awt.Color color) {
super(points, color);
this.points = points;
     }
     public void update(SimpleVector[] newPoints) {
super.update(newPoints);
this.points = newPoints;
     }
     public void draw(Graphics g, Camera cam, FrameBuffer buffer) {
Color oldColor = g.getColor();
g.setColor(super.getColor());
for (int i = 0; i < points.length-1; i++) {
     SimpleVector p1 = Interact2D.project3D2D(cam, buffer, points[i]);
     SimpleVector p2 = Interact2D.project3D2D(cam, buffer, points[i+1]);
     if (p1 == null || p2 == null)
continue;
     g.drawLine((int)p1.x, (int)p1.y, (int)p2.x, (int)p2.y);
}
g.setColor(oldColor);
     }
}

5
Support / Re: Ambient Mapping with Software
« on: February 07, 2018, 12:16:18 pm »
Yes, sorry.

6
Support / Environment Mapping with Software
« on: February 06, 2018, 06:40:35 pm »
One of my ships is shiny. I have a vague memory of talking to you about environment mapping with the software renderer. I fully expected that the environment map would not work with the software renderer, but my expectation was that the diffuse map would be completely replaced by the environment map and that the environment map would be treated as diffuse. This is not so. Ambient map acts like the ambient map but the diffuse channel disappears. To that end, I tried writing the following method. But obviously, the result is that the ambient map is just colored by the diffuse. My question, then, is since the environment mapping is already performing as expected, would it be possible to just make the diffuse channel work with it?

Code: [Select]
     private void combineAmbientAndDiffuse() {
Texture tex = TextureManager.getInstance().getTexture("EnvironmentMap");
tex.add(TextureManager.getInstance().getTexture("Starfighter.png"), .5f);
     }

7
Support / Re: Drawing a Graphic on a Separate Thread
« on: February 06, 2018, 06:36:09 pm »
That makes sense, thanks.

8
Support / Re: Drawing a Graphic on a Separate Thread
« on: February 02, 2018, 09:35:50 pm »
So, do you have a response?

9
Support / Re: Drawing a Graphic on a Separate Thread
« on: February 01, 2018, 05:34:44 pm »
It's a pre-splash graphic that's meant to run while the game is loading. Load time is as much as 20 seconds and I don't want a black or even just a static screen for that long.

10
Support / Drawing a Graphic on a Separate Thread
« on: February 01, 2018, 03:35:33 am »
Hardware renderer in (lwjgl's frame) fullscreen throws a RuntimeException ("No OpenGL context found in the current thread."). I created a WorldProcessor with two threads as well as tried it the lwjgl way (GLContext.useContext()). Neither worked.

11
Support / Re: Problem with animation model
« on: January 27, 2018, 06:29:26 am »
Any chance they're texture transparencies and the problem is a UV problem (perhaps caused by your animation)?

12
Support / Re: Interact2D
« on: January 20, 2018, 06:26:31 am »
I went with the mouse-follow demo and ray-cast. It's working but, academically, I'd still like to know how to make use of the method which takes the camera z value.

13
Support / Re: Interact2D
« on: January 19, 2018, 06:52:08 pm »
So how do I get the plane's z in cameraspace?

14
Support / Re: Interact2D
« on: January 18, 2018, 09:47:20 pm »
I don't need the height in wordspace. Only the x and the z.

15
Support / Re: Interact2D
« on: January 17, 2018, 09:29:51 pm »
I have x and y in screen coordinates, so about which z are you talking? And could you show me a snippet?

Pages: [1] 2 3 ... 104