Berkeley CSUA MOTD:Entry 23929
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/26 [General] UID:1000 Activity:popular
5/26    

2002/2/21-22 [Computer/SW/Languages/Java] UID:23929 Activity:very high
2/20    Does Java provide frame by frame control over graphical presentation?
        e.g. if Monitor refresh rate is 100 Hz, each frame would be .01 sec,
        and the programmer could specify the exact presentation for each
        frame(e.g. pixel, luminance, color, etc.) I presume it should,
        and if so, what packages provide this control?  Thanks. -nivra
        \_ i know 0 about java. but when you do double buffering with almost
           any graphics package, the back buffer doesn't get presented
           until the vertical retrace. so that's usually how you deal with
           this issue. you render as fast as you can, then call swapbuffers()
           or whatever your package calls it. and the frame gets presented
           at the appropriate time. all you need to figure out maybe is
           then how often the swapping can occur. then you have everything
           you want. and i'm sure java has an opengl wrapper. -ali
           \_ You are giving too much credit to java designers.  -- misha.
        \_ It is possible to create a full screen window in java. It is
           possible to dump whatever you want into a buffer and blit it to
           a window. It is also possible to set up timers to be notified
           when to do things.  As long as what you're  not taking too long
           in your blit loops, you can do what you're suggesting. Take a look
           at the new JDK1.4 jcanyon demo. I think that is what you're
           asking about.  http://java.sun.com/j2se/1.4/demos/jcanyon
        \_ Java3D. Not quite there, but might be along the lines of what you
           want.
        \_ And if you think you can get 100fps in any way, means, or form from
           Java...
        \_ Don't confuse the monitor scan frequency with the rate at which
           the jvm is calling "swapbuffers()" with your rendered image.
           Also, with async gc, don't assume that each time segment will
           give you the same amount of calculation (be prepared for
           "choppy" control).  100 fps is doubtful if you are doing a lot of
           work... but in general the framework is there even in the AWT
           kit (java2d might be much better here).
ERROR, url_link recursive (eces.Colorado.EDU/secure/mindterm2) 2025/05/26 [General] UID:1000 Activity:popular
5/26    

You may also be interested in these entries...
2013/4/29-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:54665 Activity:nil
4/29    Why were C and Java designed to require "break;" statements for a
        "case" section to terminate rather than falling-through to the next
        section?  99% of the time poeple want a "case" section to terminate.
        In fact some compilers issue warning if there is no "break;" statement
        in a "case" section.  Why not just design the languages to have
        termination as the default behavior, and provide a "fallthru;"
	...
2013/3/5-26 [Computer/SW/Languages/Java] UID:54618 Activity:nil
3/5     Three emergency Java updates in a month. Why do I have a feeling
        that the third one won't be the last one?
        \_ Bingo!
	...
2012/12/18-2013/1/24 [Computer/SW/Languages/Perl] UID:54561 Activity:nil
12/18   Happy 25th birthday Perl, and FUCK YOU Larry Wall for fucking up
        the computer science formalism that sets back compilers development
        back for at least a decade:
        http://techcrunch.com/2012/12/18/print-happy-25th-birthday-perl
        \_ I tried to learn Perl but was scared away by it.  Maybe scripting
           lanauages have to be like that in order to work well?
	...
2012/8/29-11/7 [Computer/SW/Security] UID:54467 Activity:nil
8/29    There was once a CSUA web page which runs an SSH client for logging
        on to soda.  Does that page still exist?  Can someone remind me of the
        URL please?  Thx.
        \_ what do you mean? instruction on how to ssh into soda?
           \_ No I think he means the ssh applet, which, iirc, was an applet
              that implemented an ssh v1 client.  I think this page went away
	...
2011/12/8-2012/1/10 [Computer/SW/Languages/Java, Computer/SW/Security] UID:54252 Activity:nil
12/8    Java code much worse IRL than pretty much everything else:
        http://preview.tinyurl.com/d5e46cq [ars technica]
	...
2011/4/16-7/13 [Computer/SW/Languages/Python] UID:54086 Activity:nil
4/16    Whoa, I just heard that MIT discontinued 6.001 (classic scheme)
        to 6.01. In fact, 6.00, 6.01 and 6.02 all use Python. What the
        hell? What has the world become? It's a sad sad day. SICP forever!
        \_ old story, they've ditched that shitty book and lang for a while.
        \_ I used to think scheme was cool, then I saw Ka Ping Yee's
           "Beautiful Code" class aka 61a in python, and converted.
	...
2011/2/24-4/20 [Computer/SW/Languages/Java] UID:54048 Activity:nil
2/24    Go Programming Language.  Anyone here use it?  It kind of
        reminds me of java-meets python, and well, that is fitting given it's
        a GOOG product.  What is so special about it?
        \_ as I understand it, it's a suitable OOP-y systems language with more
           structure than C, less complexity than C++, and less overhead than
           Java/Python.
	...
2010/8/8-9/7 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Web] UID:53914 Activity:nil
8/8     Trying to make a list of interesting features languages have
        touted as this whole PL field comes around, trying to see if they
        have basis in the culture of the time: feel free to add some/dispute
        1970 C, "portability"
        1980 C++, classes, oop, iterators, streams, functors, templates
             expert systems
	...
2009/12/5-26 [Computer/SW/Languages/Java] UID:53569 Activity:nil
12/4    what do people have their JAVA_HOME's set to on soda?
        \_ don't. are you trying to get sun java? It is installed, but not
           the default.  check dpkg -l and dpkg -L
           \_ I'm trying to run maven to get scala/lift.net working
              properly and it's complaining that JAVA_HOME is not set.
              \_ you probably want one of the directories in /usr/lib/jvm,
	...
2009/9/28-10/8 [Computer/SW/Languages/C_Cplusplus] UID:53409 Activity:nil
9/28    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
        Java is #1!!! Followed by C, PHP, C++, Visual Basic, Perl,
        C#, Python, Javascript, then finally Ruby. The good news is
        Pascal is going waaaay back up!
        \_ C is still more popular than C++?  I feel much better about myself
           now.
	...
2009/8/7-14 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Java] UID:53252 Activity:high
8/6     In C one can do "typedef int my_index_t;".  What's the equivalent in
        C#?  Thanks.
        \_ C#? Are you serious? Is this what the class of 2009 learn?
           \_ No.  I have to learn .NET code at work.  I am Class of '93.
           \_ python is what 2009 learns, see the motd thread about recent
              cal courses and languages
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
Cache (8192 bytes)
java.sun.com/j2se/1.4/demos/jcanyon -> java.sun.com/j2se/1.4/demos/jcanyon/
Reference > 16 Code Samples and Apps > 17 Join a Sun Developer Network Community 18 Profile and Registration | 19 Why Register? JCanyon: GRAND CANYON FOR JAVA As seen at 21 JavaOne 2001 JCanyon screenshot Kenneth Russell, Sun Microsystems, Inc. Contents * i. Quick Start with Java Web Start * 1. Direct Buffers * 2. JCanyon Overview + 26 Use of New File I/O + 27 Rendering Loop * 3. Flight Dynamics * 4. Frequently Asked Questions * 5. Source Code * 6. Acknowledgments * 7. Feedback * 8. References * 9. Trademarks i. Quick Start with Java Web Start System requirements: * 330 MB of free disk space * 192 MB or more RAM * 39 OpenGL(R) (is pre-installed on Windows(R) PCs and many GNU/Linux distributions) System recommendations: * 3D accelerator card with hardware texture mapping (has been tested extensively with 40 NVIDIA(R) GeForce(R) family of products) The launch links below require 41 Java Web Start. Beta will provide substantial performance improvements for this and other NIO-intensive applications. The links below are designed to work on the following operating systems: * Solaris/SPARC with 43 OpenGL for Solaris/SPARC * Solaris/x86 with 44 Mesa * GNU/Linux on x86 (Mesa is usually pre-installed; It is recommended that you change your display settings to 640x480 before launching the demo to simulate full-screen mode; OpenGL on Windows. The first time the program is launched, a 20 MB jar file will be downloaded and decompressed onto your local disk into a directory you choose. The complete source code for jcanyon is 49 available below. JNI calls 1. Java platform were the 51 JNI Get<PrimitiveType>ArrayElements and GetPrimitiveArrayCritical entry points. The implementation of Get<PrimitiveType>ArrayElements either incurs a memory allocation and data copy, which is expensive, or requires pinning support in the garbage collector, which is difficult or impossible depending on the garbage collection algorithm used by the Java virtual machine implementation (JVM). GetPrimitiveArrayCritical is fast but has severe limitations on how it can be used which make it unacceptable for many kinds of applications. JSR-000051). They are applicable to more domains than just I/O; I/O, 2D, 3D, database access, and inter-language interoperability can potentially benefit from direct buffers. The Java 53 HotSpot Client and Server VMs have been optimized to generate very efficient code for buffer operations. JCanyon is intended solely as a technology demonstration. APIs. The entire application, including the physically-accurate flight model and rendering loop, is written in the Java programming language. No native code aside from the OpenGL binding is required or used. The simulator runs at real-time rates using the Java HotSpot Client VM on a single-CPU 750 MHz Pentium III PC with an 58 NVIDIA GeForce or GeForce 2 graphics card. The rest of this paper is organized as follows. Section 3 provides details on the multiresolution algorithm and the flight dynamics. Section 4 contains answers to frequently asked questions. Section 5 provides links to the complete source code of the jcanyon demonstration. Section 6 contains acknowledgments, 64 Section 7 the alias for feedback, and 65 Section 8 references for further reading. OpenGL. Use of New File I/O The data set which jcanyon renders is comprised of roughly 100 MB (uncompressed) of elevation data, which provides the shape of the canyon and mountains, and 200 MB of satellite imagery, which provides the surface color. The data is too large to fit in RAM on most machines; Memory-mapped file I/O is used to transfer both the elevation and image data into the application. The elevation data is currently always mapped in at the highest resolution and is decimated at run time. The image data is downsampled into pyramids ahead of time and only the data of the needed resolution is mapped into memory at any given time. Imagery is fetched from the disk in a background thread and is scanned by that thread to ensure the data is in the disk cache before it becomes accessible to the main thread; Rendering Loop The inner rendering loop strides through the geometric data for a portion of the data set and assembles 3D points, as well as references to the 2D imagery in the form of texture coordinates, into a large buffer containing single-precision floating-point values. This buffer is then transferred to the graphics card for rendering. In order for OpenGL to render the buffer, it requires a persistent pointer to the buffer's starting address. There are two versions of the inner rendering loop; OpenGL, and the other uses a standard Java programming language float . Because of the semantics of the OpenGL APIs, the only correct method of sending data down to the card from a Java programming language float is to either use Get<PrimitiveType>ArrayElements (which requires a memory allocation and data copy on any JVM which does not support pinning) or to use GetPrimitiveArrayCritical and copy the data manually; Such a data copy can easily be the bottleneck in an application. This demonstration was originally intended to use the NVIDIA 67 GL_NV_vertex_array_range (VAR) extension to OpenGL for high-throughput rendering of the terrain mesh. However, after implementing the terrain engine as well as supporting code to allow the use of the VAR extension, it was discovered that enabling VAR caused a slowdown when the polygon count went up; In the meantime, VAR can be enabled by passing in the -nv command line option to DBFlyer when running on a GeForce-based card with the latest Detonator drivers. Multiresolution Algorithm The terrain renderer uses a variant of the algorithm described in 68 LKR96 . The data set is subdivided into roughly 200 tiles and measures 13 by 15 tiles. Each tile contains both elevation and image data. At the highest resolution, each tile measures 513x513 elevation samples and 512x512 image samples. Tiles are downsampled into pyramids by recursively dropping every other sample. Image pyramids for texture mapping are created off-line. The geometric data is decimated at run time by iterating through the highest-resolution data with an appropriate stride. Maximum deltas as described in 69 LKR96 are computed off-line for each level of the elevation data pyramid. These deltas are defined as the maximum world-coordinate error incurred in the vertical direction by rendering a given tile at the next-lower resolution. The level-of-detail (LOD) selection algorithm is somewhat dependent on the deltas being monotonically increasing, so a quadratic curve is fitted to these deltas and they are subsequently resampled. However, this technique is not currently guaranteed to produce monotonically increasing deltas and, in fact, several tiles in the database produce deltas which are not increasing. The resulting visible effects have not yet been characterized. During rendering of each frame, the position of the camera is compared to the centroid of each visible tile. The maximum screen-space error is computed and compared against the precomputed maximum deltas; Thus, LOD selection is performed for each tile every frame and each tile's LOD is independent. The two primary contributions of jcanyon's rendering algorithm are its texture selection technique and a method for eliminating cracks in the surface called filleting. Texture selection It was observed that using the same algorithm for texture LOD as is used for geometry LOD caused unacceptable visual artifacts, as too-coarse textures were frequently selected. Synthetic "deltas" for the textures were created and the texture LOD selection decoupled from the geometry, but tuning of the texture deltas did not yield acceptable results; LOD algorithm to incorrectly shift to too-coarse LODs for tiles directly underneath the camera. Instead, a new algorithm was devised for selection of texture LODs. This algorithm is an approximation to screen-space error for images, and takes into account that the visible area of the texture decreases first as the tile moves further away from the camera, and second as the angle between the normal vector of the tile and the forward vector of the camera approaches 90 deg...