www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Jubilex on March 08, 2004, 11:30:08 am

Title: Is it possible to render to a texture?
Post by: Jubilex on March 08, 2004, 11:30:08 am
Is that possible?  And if so, how do I do it?
Title: Is it possible to render to a texture?
Post by: EgonOlsen on March 09, 2004, 05:13:05 pm
Using the software or the hardware renderer? It's not possible by calling a method that does it or similar, but it's somehow possible to achieve it when using the software renderer (hence my question).
Title: Sorry.. hardware rendering.
Post by: Jubile on March 09, 2004, 09:32:14 pm
I'm trying to make a small game (based on your FPS demo) and hence I'm using OpenGL.. the software rendering is not fast enough IMHO..

BTW: I have a little problem. I have an arena positioned inside a sphere. The problem is the lighting of the sphere looks very odd. The bottom is completely lit and so is a strip down one of the sides.

Perhaps I could send you some code so that you can see the problem?
Title: Re: Sorry.. hardware rendering.
Post by: EgonOlsen on March 09, 2004, 10:50:10 pm
Quote from: "Jubile"
BTW: I have a little problem. I have an arena positioned inside a sphere. The problem is the lighting of the sphere looks very odd. The bottom is completely lit and so is a strip down one of the sides.
Maybe the light is discarded before reaching the sphere. If you based you work on the fps-example, this is very likely to happen, because the example modifies the discard distance. Have a look at Config.lightDiscardDistance...maybe it helps. Keep in mind that performance will decrease the higher this value is set. How much depends on your polycount.
About the render-to-texture: If you are using OpenGL, this is not really possible. It could be done if the rendering to a texture happens only once or at least very seldom, but for frequent updates, there's no way ATM.
Title: Damn, I'm just being stupid..
Post by: Jubilex on March 09, 2004, 11:29:10 pm
The lighting problem was a Bug No. 40 (a.ka. the failure is approx. 40 cm from the screen). I used the stamp tool in photoshop to make the texture and probably couldn't see the entire texture when i made it and didn't think about  that. So the texture was white at bottom and at the right side.. well.. problem solved.
I have looked a lot at your fps example and right now I am refactoring it into several smaller classes. I think it is easier to work with. Also made a small class to write text to the screen. Found a complete font on the net.
When I get a little further I would be willing to share the source. Maybe someone could use it. I have removed all the software rendering though as I will not be using that.

Best regards and good night :-D