Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (526)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Morph node support committed  (Read 2503 times)
0 Members and 1 Guest are viewing this topic.
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Posted 2003-11-08 19:45:03 »

Morph node implemented and committed to CVS. Minor related modifications made to some classes in com.xith3d.scenegraph.

Morph node test added as Xith3DMorphPyramid2CubeTest.bat and Xith3DMorphPyramid2CubeTest.java. This test is similar to Pyramid2Cube example from Java3D demos.

I tested only geometry and color morphing. Normal and texture coord morphing is also implemented but not tested. It would be great if someone will post here feedback regarding normal/tex coord morphing.

Yuri


Yuri Vl. Gushchin
JProof Group
Offline Daath

Junior Devvie




Java games rock!


« Reply #1 - Posted 2003-11-08 20:15:35 »

Great job Yuri -  could you please comment on how's memory consuption compared to the Morph node in Java3d ( where that node was practically unusable) ?
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #2 - Posted 2003-11-08 20:55:55 »

Current implementation allocates one additional copy of geomerty arrays data passed to Morph constructor. This is not so memory-efficient, but allows to prevent multiple memory allocations during normal morphing process. This is only way to keep copy of the data because of they are stored in GeometryArrays as NIO buffers. This technique allows use on the same geometry in both normal shapes and morph nodes.

Normal morphing does not consume memory, because of data placed directly to NIO buffers which renderer implementation passes directly to OpenGL.

Morph node has special performance shortcuts for cases where the weights array contains only one, two or three non-zero values.

Xith3D implementation of Morph has no constraint on sum of weigts to be equal to 1.0, which allows some interesting morphing effects.

Yuri

Yuri Vl. Gushchin
JProof Group
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abies

Senior Devvie





« Reply #3 - Posted 2003-11-08 21:05:56 »

What do you think about refactoring buildCompatibleGeometry into GeometryArray virtual method ? It could be useful for broader audience - and at the same time we can avoid instanceof if/else ladder.

BTW, can I go through source and try to refactor 'if ( this instanceof SomeClass )' in few places to overridden methods ? I know it is sometimes easier this way, but I doubt if there is any less OO syntax possible in java Wink

Artur Biesiadowski
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #4 - Posted 2003-11-09 03:43:04 »

Yes, we can potentialy use something like duplicateNode(forceDuplicate).

Quote
It could be useful for broader audience - and at the same time we can avoid instanceof if/else ladder.


Agree. Let me check how we can do this without introduction of a new method, so we will stay compatible with Java3D and avoid this 'if instanceof'.

Yuri

Yuri Vl. Gushchin
JProof Group
Offline kevglass

« JGO Spiffy Duke »


Medals: 210
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2003-11-09 06:30:26 »

Morph node seems to work great. The MD2 loader is now ported over to Morph for its animation. The normals seem to work fine.

Nice work Yuri!

Kev

Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #6 - Posted 2003-11-09 07:00:19 »

I am seriously thinking about implementing native-code-accelerated version of Morph node (which will use SIMD [SSE/SSE2/3DNow]) and placing it in xith-tk. But this is not a top priority for a moment.

Yuri

Yuri Vl. Gushchin
JProof Group
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #7 - Posted 2003-11-09 08:59:14 »

abies,

Quote
BTW, can I go through source and try to refactor 'if ( this instanceof SomeClass )' in few places to overridden methods ?


I just reviewed Java3D docs and think that we should add implementation of cloneNodeComponent(boolean forceDuplicate) and duplicateNodeComponent(NodeComponent originalNodeComponent, boolean forceDuplicate) to GeomContainer override them in TriangleArray, QuadArray etc. so the code of Morph.buildCompatibleGeometry(...) will transform to

private void buildCompatibleGeometry(GeometryArray a) {
   setGeometry((GeometryArray) a.cloneNodeComponent(true));
}

Will be great if you can do this - just send patch file to Issues and I will review and apply it.

BTW, I think that for duplicating geometries we can treat GeomDataInterfaces as elementary types and duplicate them always (not taking care of forceDuplicate flag).

Also looks like we should introduce private no-parameter constructors in some classes (PointArray, LineArray etc.) to follow design of cloneNodeComponent(...).

Yuri


Yuri Vl. Gushchin
JProof Group
Offline abies

Senior Devvie





« Reply #8 - Posted 2003-11-09 14:15:19 »

Quote
I am seriously thinking about implementing native-code-accelerated version of Morph node (which will use SIMD [SSE/SSE2/3DNow]) and placing it in xith-tk. But this is not a top priority for a moment.

Maybe opengl-accelerated one ? I think that ATI has explicit weight extension for it, while NV needs vertex program. This way, morph node could live in static GPU VBO, with interpolation done on the card.

Artur Biesiadowski
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #9 - Posted 2003-11-09 19:08:56 »

Quote
Maybe opengl-accelerated one?


Would be a good addition. The only question is compatibility in this case, but this is a matter of testing.

If we will go to OpenGL-accelerated version, we will also need additional atom class for Morph, so this is more conceptual enhancement. With transforms executed on CPU we can keep the same shader for both Morph and Shape3D, which is easier for a moment, and we can postpone these enhancements a bit.

Yuri

Yuri Vl. Gushchin
JProof Group
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abies

Senior Devvie





« Reply #10 - Posted 2003-11-10 17:43:29 »

I have added clone node functionality
http://xith3d.dev.java.net/issues/show_bug.cgi?id=37

Artur Biesiadowski
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #11 - Posted 2003-11-10 17:56:50 »

Patch from Issue#37 already integrated into CVS. Thanks abies for this patch.

If you were instantiating directly some formerly abstract classes such as GeometryArray [i.e. those which were declared abstract in Java3D API], please note that they became abstract and now match Java3D API.

Yuri

Yuri Vl. Gushchin
JProof Group
Pages: [1]
  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.

toopeicgaming1999 (73 views)
2014-11-26 15:22:04

toopeicgaming1999 (62 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (56 views)
2014-11-12 21:11:50
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!