Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4 5 6
  ignore  |  Print  
  The JWS thread *Xith3D demos only*  (Read 30942 times)
0 Members and 1 Guest are viewing this topic.
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #60 - Posted 2004-01-26 03:01:00 »

Added "new" demo
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #61 - Posted 2004-01-29 13:08:16 »

Update:
Modified the CelShading vertex shader's code; In the new version, it only receives an input parameter (At start up) and hence runs a bit faster.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
!!ARBvp1.0

ATTRIB OriginalPos                = vertex.position;
ATTRIB TmpNormal                = vertex.normal;

PARAM lightAngle                                =   program.env[0];
PARAM ModelViewProj[4]                    = { state.matrix.mvp };
PARAM ModelViewInvertTranspose[4] = { state.matrix.modelview.invtrans};

TEMP TmpVector;  
TEMP TmpShade;
TEMP temp;
  
DP3  TmpVector.x, TmpNormal, ModelViewInvertTranspose[0];
DP3  TmpVector.y, TmpNormal, ModelViewInvertTranspose[1];
DP3  TmpVector.z, TmpNormal, ModelViewInvertTranspose[2];

DP3  TmpVector.w, TmpVector, TmpVector;
RSQ  TmpVector.w, TmpVector.w;
MUL  TmpVector  , TmpVector, TmpVector.w;

DP3  TmpShade.x, TmpVector , lightAngle;      
MAX  TmpShade.x, TmpShade.x, 0.0;

DP4 temp.x, ModelViewProj[0], OriginalPos;
DP4 temp.y, ModelViewProj[1], OriginalPos;
DP4 temp.z, ModelViewProj[2], OriginalPos;
DP4 temp.w, ModelViewProj[3], OriginalPos;

MOV result.position     , temp;
MOV result.color        , vertex.color;
MOV result.texcoord[0].x, TmpShade.x;

END


The perpixel lighting demo now comes in two flavors:
Vertex Shaders accelerated with per-vertex lighting computations done strictly in the GPU, and the regular version which is more CPU dependant.
The regular version as well as the GPU accelerated one include  an ObjectStructure class that would take any indexedGeometry and then compute the TBN vectors needed for per-pixel lighting.
It is also over 50 times faster than the old version which used ArrayList for vertex caching...
You can also hit V and see the TBN vectors where normal are colored in Red, Binormals in Green and Tangents in Blue.
As I mentioned in some other thread, I passed the Tangents components to the Vertex Shader in the GPU accelerated version as color components since TexCoord3f is not supported yet, hence can't pass them as texture coordinates.
Binormals are computed in the GPU by calling XPD (cross product) and using Tangents and normals.
I assume the rest is easy to figure (I for one never had assembly before Tongue)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
!!ARBvp1.0

# Original Input...
ATTRIB OriginalPos      = vertex.position;
ATTRIB tangent            = vertex.color;
ATTRIB normal             = vertex.normal;

PARAM ModelViewProj[4]  = { state.matrix.mvp };
PARAM lightOSL                 = program.env[0];
PARAM halfVector              = {0.5, 0.5, 0.5, 0.5};

TEMP lightVector;
TEMP colorVector;
TEMP temp;
TEMP binormal;
  
#Computing the binormal: normalize(cross(tangent, normal))
XPD binormal, tangent, normal;

SUB lightVector, lightOSL, OriginalPos;

DP3 lightVector.w, lightVector, lightVector;
RSQ lightVector.w, lightVector.w;
MUL lightVector , lightVector, lightVector.w;

DP3 colorVector.x, lightVector, tangent;
DP3 colorVector.y, lightVector, binormal;
DP3 colorVector.z, lightVector, normal;

MAD colorVector , colorVector, halfVector, halfVector;

DP4 temp.x, ModelViewProj[0], OriginalPos;
DP4 temp.y, ModelViewProj[1], OriginalPos;
DP4 temp.z, ModelViewProj[2], OriginalPos;
DP4 temp.w, ModelViewProj[3], OriginalPos;

MOV result.position, temp;
MOV result.color, colorVector;
MOV result.texcoord[0], vertex.texcoord[0];
MOV result.texcoord[1], vertex.texcoord[1];

END


/me back coding.
PS: One of the major flaws in the way I implemented VS in xith3d, is the fact that the VertexShaderProgram leaks to the other Shape3Ds in the scene.
A temporary fix is to set a new VertexProgram() element to all the appearances that you don't want the VSing effects to show on.
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #62 - Posted 2004-02-05 17:45:09 »

New Demo: Phong Lighting yay Tongue
Check the front page for links Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #63 - Posted 2004-02-05 23:02:40 »

Ok so I went through all my demo and gave them a serious tweaking, so now they run better and faster than ever.
Also the code is now a lot cleaner and more efficient.
I re-wrote the PerPixel lighting shader so that the lightWorldPosition -> lightObjectPosition -> lightSpaceTangentPosition transformations are done entirely on the GPU  Grin
/me off writting a new demo Wink
PS: Sorry for those who still have a < DX8.0 card but from now on I will almost exclusively write demos using PS and VS shaders.
I would also like to have some feedback on the performance that you guys get running them demos on your machines. Something like that:

GFX  ATi Radeon 9700 Pro
CPU Athlon XP 2.1 GHZ
MEM 512 DDR
MOB NForce 2
DEM Phong Lighting
FPS  ~280

Thanks:)
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #64 - Posted 2004-02-07 00:49:24 »

Big release coming tomorrow Wink

A tiny preview

Offline Java Cool Dude

Senior Duke




Java forever


« Reply #65 - Posted 2004-02-10 03:44:59 »

Check first page Wink
Anyways this new demo uses normal maps for true perpixel, phong lighting: it took me a while to put it together but I eventually got over the tough stuff Grin
This is in my opinion the best demo I've written so far and I'm quite proud of my achievement.
Anyways I've enabled TexCoord3f in the GeomertryContainer to have this demo working. In fact I had to pass the Tangent and Binormal vectors to the GPU using the second and third TextureCoordinates' elements to transform the light as well as the view position into Tangent space.
However since I have no urgent need in using Texture3D per se, I didn't bother implementing it Tongue

PS: You can use F1 to take a screenshot that will be saved under the name screenshotn.jpg where n is the number of screens you've saved so far (won't overwrite previous screenies Wink).
Offline aNt

Senior Duke




AFK


« Reply #66 - Posted 2004-02-10 06:25:50 »

nice Smiley
Offline zparticle

Senior Duke




Thick As A Brick


« Reply #67 - Posted 2004-02-10 12:14:57 »

Hmm, won't run. No error just dies after the splash screen. Here is my card info from another program, this is work so this card is not very good.

OpenGL Renderer = Intel Brookdale-G
OpenGL Version = 1.3.0 - Build 4.13.01.3069
OpenGL Vendor = Intel
OpenGL Extensions = GL_ARB_multitexture GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_env_crossbar GL_ARB_transpose_matrix GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_EXT_cull_vertex GL_EXT_fog_coord GL_EXT_packed_pixels GL_EXT_packed_pixels_12 GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_stencil_wrap GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_filter_anisotropic GL_3DFX_texture_compression_FXT1 GL_IBM_texture_mirrored_repeat GL_NV_texgen_reflection GL_WIN_swap_hint


Offline Java Cool Dude

Senior Duke




Java forever


« Reply #68 - Posted 2004-02-10 13:02:10 »

Intel's onboard graphic chips (and even extension cards if they have any) do not support  GL_VERTEX_PROGRAM_ARB and GL_FRAGMENT_PROGRAM_ARB, hence can't run my demo.
Maybe I should write a quick checking function?
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #69 - Posted 2004-02-11 01:42:53 »

Quote
Hmm, won't run. No error just dies after the splash screen.


Ditto.

Test system: Linux (Fedora), Nvidia GForce 2 MX 400, latest drivers.

A check would be nice, anything but "just dies" is good Wink

the screen shots look great though Smiley

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #70 - Posted 2004-02-11 02:43:34 »

Quote


Ditto.

Test system: Linux (Fedora), Nvidia GForce 2 MX 400, latest drivers.

A check would be nice, anything but "just dies" is good Wink

the screen shots look great though Smiley

Will.


Nvidia GForce 2 MX 400 = Pixel & Vertex Shaders = teh noes... :-/
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #71 - Posted 2004-02-11 05:08:06 »

Updated with non-robust shadow volumes and gloss maps.
I will be working on implementing more features this week, stay tuned Smiley
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #72 - Posted 2004-02-15 17:25:41 »

Updated all demos except the latest entry and they should work on a Mac now Smiley
Offline StefanD2

Senior Newbie




Java games rock!


« Reply #73 - Posted 2004-02-15 17:48:19 »

Quote
Hmm, won't run. No error just dies after the splash screen.  


Ditto. Even the flag simulation dies silently before showing the resolution dialog ...

Test system: Windows 2000, Nvidia GForce 3 Ti 200, latest drivers.

I wonder why the GForce 3 series is not working either since it does support Direct X 8.1 (at least nvidia claims that) ...

PS: Seems to be related to somewhere near the basic framework i.e. the dialog that allows to select the window size does never show up ... Your particle demo still does work.
Offline Ramses

Senior Newbie




Java games rock!


« Reply #74 - Posted 2004-02-15 18:43:52 »

For some reason only the particle generator and the water simulation are working on my comp now. With the exception of the shader demos, all used to work fine before. FYI, i have a radeon 8500DV. The demos just die, without any error message, after the splash screen.

I'll try running it from source to see if I can track down the cause, but I thought I'd make this note in case you made a recent change JCD that might have caused the break.  Huh
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #75 - Posted 2004-02-15 18:53:04 »

Try now.
Here's the source code if for some reasons the dialog box won't show up for ya
Source
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #76 - Posted 2004-02-15 18:56:23 »

Quote
For some reason only the particle generator and the water simulation are working on my comp now. With the exception of the shader demos, all used to work fine before. FYI, i have a radeon 8500DV. The demos just die, without any error message, after the splash screen.

I'll try running it from source to see if I can track down the cause, but I thought I'd make this note in case you made a recent change JCD that might have caused the break.  Huh

That's strange the water demo is hardly any different structure wise from the cloth and flag sims.
Also, the shader demos should work fine on your computer since the Radeon 8500 supports PS and VS...
PS: My xith3D jar file is heavily modified in a sense where I actually added support for PS and VS, Dot3 extension, dynamic shadows sources, TexCoord3f etc...
Offline StefanD2

Senior Newbie




Java games rock!


« Reply #77 - Posted 2004-02-15 19:27:27 »

It's too late for me to find solutions quickly today I do believe... Are you using Java 1.5 or another compiler? That seems to be the cause (thank god that webstart does alllow logging):

Java Web Start 1.4.2_03 Konsole, gestartet Sun Feb 15 23:24:03 CET 2004
Java 2 Runtime Environment: Version 1.4.2_03 von Sun Microsystems Inc.
java.lang.UnsupportedClassVersionError: FlagSimulation (Unsupported major.minor version 49.0)
     at java.lang.ClassLoader.defineClass0(Native Method)
     at java.lang.ClassLoader.defineClass(Unknown Source)
     at java.security.SecureClassLoader.defineClass(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader.access$100(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
     at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
     at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
     at com.sun.javaws.Launcher.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)

So maybe a javac -target 1.4 or a release below that one could help here
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #78 - Posted 2004-02-15 20:03:45 »

Indeed I'm using 1.5 SDK, I recompiled everything using target -1.4.
Should work now :-/
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #79 - Posted 2004-02-16 01:51:28 »

An error occurred while launching/running the application.

Title: Water Simulation
Vendor: Abdul Bezrati - Galactic Village
Category: Unexpected Error

RippleFactory (Unsupported major.minor version 49.0)

Offline Java Cool Dude

Senior Duke




Java forever


« Reply #80 - Posted 2004-02-16 02:14:34 »

Ok compiled everything again using the -source1.4 command line (I'm using Tiger), now everything should be fine.
I even wrote a little function to check for VS and PS availibility...
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #81 - Posted 2004-02-16 18:33:36 »

Ok what would you guys like to see next?
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #82 - Posted 2004-02-16 18:55:24 »

I tweaked the celshading demo a bit and now it runs 300% faster (almost as fast as while idling) while rotating Smiley
Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #83 - Posted 2004-02-16 19:23:29 »

Indeed. Seems to run at at least 300fps on OSX even under less than ideal circumstances.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline hawkwind

Junior Duke




Java games rock!


« Reply #84 - Posted 2004-02-16 21:21:31 »

The phong demo still does nothing for me...a blank window comes up then nada, my mozilla download manager says nothing is coming down the line...want at see...really Tongue Tongue
Offline hawkwind

Junior Duke




Java games rock!


« Reply #85 - Posted 2004-02-16 21:26:17 »

can you post a jar with source and images....to many items to manually copy...please Roll Eyes Roll Eyes
Offline Java Cool Dude

Senior Duke




Java forever


« Reply #86 - Posted 2004-02-16 23:15:17 »

I took down the phong demo since I've got to tweak it a lot more before anything is made public, sorry for the inconvenience.
To download the source files and other binaries, go right here
Offline hawkwind

Junior Duke




Java games rock!


« Reply #87 - Posted 2004-02-16 23:28:51 »

inconveinience?? Huh Ha Ha  never look gift code in the mouth...err something like that.  

Saw your source dirs earlier was wondering if it twer all neatly zipped somewhere...the cutting...the pasting...oh me ach'in mouse...I am lazy I was hoping to grab it all at once.

Is all cool stuff....hope you realize that at some point we expect you to write some at least minimal tut's to explain some of this coolness....
Offline hawkwind

Junior Duke




Java games rock!


« Reply #88 - Posted 2004-02-18 11:03:54 »

What/where are things like FragmentProgram or VertexProgram defined?? Huh
Offline hawkwind

Junior Duke




Java games rock!


« Reply #89 - Posted 2004-02-18 11:18:20 »

found the vertex/fragment program code...are these things thta will eventually endup in the main xith3d source?? Huh
Pages: 1 2 [3] 4 5 6
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!