Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
heeen
May 14, 2005

CAT NEVER STOPS

Hubis posted:

Cool! Is this view-dependent LOD?

View dependent subdivision surfaces with displacement mapping.

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

heeen posted:

View dependent subdivision surfaces with displacement mapping.

NERD ALERT

Fecotourist
Nov 1, 2008

heeen posted:

View dependent subdivision surfaces with displacement mapping.

Are you using a geometry shader?

heeen
May 14, 2005

CAT NEVER STOPS

Fecotourist posted:

Are you using a geometry shader?

No, all in CUDA.

RussianManiac
Dec 27, 2005

by Ozmaugh

heeen posted:

View dependent subdivision surfaces with displacement mapping.

So pretty much this means that the level of subdivision is controlled by how far away or at which angle you are viewing the object from?

Ferg
May 6, 2007

Lipstick Apathy
Worst screenshot ever:



The project is a self-hosting web framework. We don't use a SQL-based database at work so I'm trying to build an app framework that strips out the SQL database "dependency" but still allows for solid development. The fact that it's self-hosting is just an effort to learn a little bit about the thought process behind a web server.

All in all the framework will be based entirely upon the Python standard library. Zero dependencies to run it, and anything a user wants to add is their responsibility. If I end up using this for a project at work, I'll add in the database support manually. Currently it supports routing AJAX requests via GET (still need to work out a method for handling POST), I've got session handling in the works, caching in the future as well as template support.

Supervillin
Feb 6, 2005

Pillbug

Ferg posted:

Worst screenshot ever:



I wish all servers had this default page on install.

dancavallaro
Sep 10, 2006
My title sucks


It's a graphical editor and solver for "Rush Hour"-type games (http://www.thinkfun.com/RUSHHOUR.ASPX?PageNo=RUSHHOUR is the original Rush Hour Traffic Jam game, but there's also "Blocked" for the iPhone and tons of knockoffs). You drag the pieces onto the grid to set up the configuration, and press solve and it shows you how to solve the configuration, or lets you know if no solution exists.

It started out as just a little project written in Java, but I've never written an iPhone app before so I thought it would be fun to port it to Objective-C and get it running on the iPhone. Not really sure what I'm going to do with it, but it's a fun project nonetheless.

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

RussianManiac posted:

So pretty much this means that the level of subdivision is controlled by how far away or at which angle you are viewing the object from?

Ideally, a view-dependent LOD system will subdivide the geometry based on the screen space error between the current subdivision level and the "true" model. Usually the exact values of the screen-space error is complicated/expensive to compute, so most methods use some approximation accounting for view distance and angle (both of which affect how much a given geometry change appears in the final image) as well as possibly some shading parameters like normals or proximity to local lights.

heeen posted:

No, all in CUDA.

I'd be very curious to see any more pictures/slides/information if you've got a link to a write-up available somewhere.

The_Frag_Man
Mar 26, 2005

Contero posted:

Not exactly a huge project, but I'm pretty happy with my shader that lets me paint an arbitrary number of textures onto a heightmap. It still uses a triangle strip but only 4 multitexture spots. If it needs a 5th texture it ends the triangle strip and swaps out the least recently used texture and starts again. This is with GLSL btw.



Could you tell us how this works?

That Turkey Story
Mar 30, 2003

Started fooling around with homebrew DS stuff today. Sup, Mandelbrot:



Takes a few seconds to render on the DS because I'm using software floating point, but still cool.

Contero
Mar 28, 2004

The_Frag_Man posted:

Could you tell us how this works?

I have a 2d array of heights, and a 2d array of ints representing some texture I've loaded into memory that I want painted on that vertex. I draw the scene one triangle strip at a time. For each x/z coordinate I can look up a y-value and a texture.

At first I just load the first 4 textures I'll be using first into each of OpenGL's multitexturing slots. I draw the first 4 points of the triangle strip. For each pair of vertices after the first 4, I look at their textures. If one or both of them use a texture I don't have loaded, I end the triangle strip, go back 2 vertices, load the appropriate textures (choosing the least recently used textures to be replaced) and start the triangle strip over again. Since I only ever consider 4 points at a time, I only need 4 multitexture spots.

As for the actual shader, I just pass in a varying vec4 for each vertex that has one of it's values set to 1.0 and the rest 0.0. This represents which of the 4 loaded textures to associate with that vertex. Since it's varying, it'll be something like { 0.2, 0.3, 0.5, 0.0 } at some pixel between the vertices. I then use those values to do a weighted average of the samples from each of the 4 textures for the color at that pixel.

tripwire
Nov 19, 2004

        ghost flow

That Turkey Story posted:

Started fooling around with homebrew DS stuff today. Sup, Mandelbrot:



Takes a few seconds to render on the DS because I'm using software floating point, but still cool.

Thats awesome. Do you have any pointers on how to get started with DS homebrew stuff like this? Even being able to see how you did the mandelbrot would be really interesting to me.

That Turkey Story
Mar 30, 2003

tripwire posted:

Thats awesome. Do you have any pointers on how to get started with DS homebrew stuff like this? Even being able to see how you did the mandelbrot would be really interesting to me.

It's actually really, really simple. There's no OS and basic drawing to the screen is literally a matter of initializing a pointer to the location of the buffer and writing to it. Everything together ended up being only about 60 lines.

To get up and running all you need is devkitpro. I set up the ARM compiler in Code::Blocks and used Boost.GIL just because setting up Boost on DS seemed like a sick idea that I had to try. GIL has sample code for virtual image views that I just adapted slightly to handle the 5:5:5:1 rgba color format that the DS uses -- thanks to GIL, all that was necessary was applying a template metafunction to generate an appropriate pixel type which I used to make an image view directly to memory. C++/Boost owns.

Get used to not working with floating point though since there is no hardware support meaning operations on them are slow as hell. There is hardware support for fixed point operations, however, that you can access via library functions included in ndslib that comes with devkitpro. Avoid floats/doubles/long doubles since, again, they're going to be done in software.

the wizards beard
Apr 15, 2007
Reppin

4 LIFE 4 REAL
Wow, do you think the slow frame rate is because you using Boost? Seems like a lot of overhead for a machine with a 4mb memory.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
He blamed floating point in both of his posts and dedicated an entire paragraph to warning against the "slow as hell floating point."

That Turkey Story
Mar 30, 2003

the wizards beard posted:

Wow, do you think the slow frame rate is because you using Boost? Seems like a lot of overhead for a machine with a 4mb memory.

There is little-to-no overhead for Boost. I'm not even linking to any prebuilt code. Like most Boost libraries, GIL is header only and all of the templates are only instantiated if they are used. Of what I used, everything is just interface wrappers that get compiled out entirely, which is how generic libraries should be. Making a virtual image view literally consists of creating storage on the stack for dimensions of the image and nothing more, the pixels are all lazily evaluated (virtual doesn't mean virtual functions, it means that the image isn't actually stored anywhere). Similarly, a GIL image view over memory just encapsulates a pointer to the start of the buffer, dimensions and stride -- thats it. Everything is entirely stack-based and the operations internally all just deal directly with unwrapped pointers and functions themselves end up inlined. The benefit is that GIL provides an essentially no-overhead layer of abstraction that lets you work with any combination of image types you can think of and provides a few basic algorithms that are instantiated specifically for the types you are dealing with when used. It is compiled-out entirely and yet it is generic enough to quickly drop in and easily work with the odd pixel format. That's why generic programming in C++ owns.

Mustach posted:

He blamed floating point in both of his posts and dedicated an entire paragraph to warning against the "slow as hell floating point."
Yeah, seriously. I do millions of floating point operations total for the whole image.

That Turkey Story fucked around with this message at 08:12 on Jan 6, 2010

SlightlyMadman
Jan 14, 2005

I've been putting together a free and open source ticket sales site:


I've always been shocked by the price of ticket sales sites, so I wrote my own for a local Burning Man event years ago. I've gotten a lot of people asking me if they could use it for their events, but the code was never really in a state for it, so I rewrote the whole thing in Django and it's going live this week.

Not pictured is also a python client application that's used to set up a POS system at the event for checking people in via scanned entry barcodes issued from the website.

I'll soon be setting it up on Amazon Web Services as an on-demand service that should be able to handle pretty much any volume of ticket sales.

Innominate
Sep 2, 2004
The Innominate

SlightlyMadman posted:

I've been putting together a free and open source ticket sales site:


I've always been shocked by the price of ticket sales sites, so I wrote my own for a local Burning Man event years ago.
...
I'll soon be setting it up on Amazon Web Services as an on-demand service that should be able to handle pretty much any volume of ticket sales.

While the odds are unbelievably stacked against you, I can't help but hope you succeed anyways. Where I live ticketmaster is currently charging something like 3-5x box office price for NHL tickets. I wish someone would break the ticketmaster monopoly and bring the while online ticket thing down to a reasonable level. Small is the only way to start doing so.

SlightlyMadman
Jan 14, 2005

I don't actually see my service as competing with TicketMaster. If somebody wants a big megacorp to handle everything for them, they can choose TM, or one of a dozen other ticketing vendors out there (In-Ticketing, Brown Paper Tickets, Mission Tickets, etc.). While I'm offering a hosted service as a favor to other Burning Man events, the main purpose of the system is for it to be a sort of turn-key DIY solution.

You set it up and manage it yourself, pay Amazon directly for the hosting charge, then set up the POS software on any old laptop laying around. It completely cuts out the middle-man in the process, which is great for small events who would rather deal with the customers directly. For an NHL game or a U2 concert, it makes more sense to go with an established 3rd-party vendor.

Vanadium
Jan 8, 2005

That Turkey Story posted:

It's actually really, really simple.

In that case, would you mind posting the code?

That Turkey Story
Mar 30, 2003

Vanadium posted:

In that case, would you mind posting the code?

http://codepaste.net/o48xau

tripwire
Nov 19, 2004

        ghost flow
Thanks a lot TTS!

Dr. Glasscock
Apr 15, 2004

HOO-DAH!!! Fatal Wiimote blow to the face, 20 points!
Ticketmaster also charges such bullshit prices for their "processing fees" or whatever. I understand they need to recoup their development costs and continue to maintain a company, but gently caress there's no way they have to charge that much. Cheap $20 tickets can double in price (I know some of that is related to the venue or something, but some is also Ticketmaster). I hate them so much.

SlightlyMadman
Jan 14, 2005

Yeah, my theory is that for smaller events, the proprietors should be able to sell tickets for absolutely free if they're just willing to spend a few hours here and there to manage things themselves. There's no printing or shipping costs, because all that the purchaser needs to do is print out a barcode (or write down their confirmation number), and bring it with them. They'll then scan or type it in using commodity hardware ($40 barcode scanner and any old lovely computer), and that's all there is to it.

Tommy Calamari
Feb 25, 2006

You see, there are three things that spur the mollusk from the sand
These were the projects I was working on a couple of months ago before I burnt myself out on programming. Typing this up will hopefully inspire me to take them further - bit depressing to see how much effort I put in just to abandon them.

Metroland


Click here for the full 1024x600 image.



Click here for the full 1024x600 image.


This started as an attempt togenerate random cities with a "European" shape: by randomly scattering points that represent the small villages which eventually merged into a city. Each village has a road to neighbouring villages; these become the thoroughfares of the city.

Working out which points are neighbours was far more complicated than I anticipated, so I'm pretty proud of coming up with an algorithm that does it (even though I've sinced discovered that these things are called Voronoi diagrams, and there are already far better algorithms out there). You can see that I never quite figured out the map edges.

The city generator became a jumping off point for the game I always wanted to exist: a high level transport simulator with a heavy focus on the network layout. I love both Sim City 4 and Open TTD, which come very close (with various patches), but there's always more than I want to deal with (zones, depots, etc). Each point has a number of residents and jobs; residents are mapped to jobs when the map is created. Your transport network has to actually take people from their home to their job (not just anywhere, a la vanilla TTD). This is also my first attempt at pathfinding; I just implemented the A* algortithm and a binary heap to go with it. Every time you change the network, it has to recompute the paths between every station - it takes a couple of seconds to do it on my slow little netbook, which I find acceptable. The interchanges at stations are also acknowledged (to stop people taking crazy routes across 9 lines, etc), though this could use some improvement.

I originally wrote this as console app in Java with an option to export an image, but drifted over to C++/DirectX and ported it over. The original idea of doing it in DirectX was that you would be able to play it like a game - start with a random city with roads, no metro and a bit of cash. However, I realised that I'd built a good framework for a London Underground sandbox and pursued that instead. Took a while, but I eventually found data for station locations, jobs and residents. It's slightly out of date (East London Line, no Circle Line extension, etc). I'm using 'wards' as my areas, unless there is already a station in that ward, in which case I just use the station(s). It'd be very easy to swap in data for another city. The lack of mainline stations throws the whole realism thing out, but line "load" (thickness of line) looks reasonable. You can extend lines, remove parts and see how it fucks things up.

I'd like to smooth the rough edges off this thing (god drat that red needs to be toned down), and actually get it out so other people can have a look - I've never taken anything that far before.

Tunnel Vision


Click here for the full 1024x600 image.


This looks pretty unremarkable (though special to me because it's my first attempt at anything other than top down tiles). Apologies for the shameless asset borrowing - I have no interest in drawing sprites.

The original concept here was to have a parallel world that you explore by wandering around the real world with a GPS. Obviously this requires a huge map (as big as the earth!), so everything is calculated on the fly using a Perlin noise based algorithm. That allows me to have a cohesive world map while only maintaining an awareness of a very small part of it.

As you get towards the date line/south pole, this takes some very large numbers/fine division which seems to cause the native C++ types to trip up - I haven't fixed this yet. The Perlin noise calculation also requires a fair bit of interpolation, which slows things down with too many tiles (hence the old school zoomed out "populus" style map). I should probably try and do this through Direct X.

The GPS code is there (tested on one old Garmin GPS), but I've focused more on getting the engine right and I might use it as the basis for a more ambitious project.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Tommy Calamari posted:

:words:
Well done. Both those projects look awesome. :)

Zakalwe
May 12, 2002

Wanted For:
  • Terrorism
  • Kidnapping
  • Poor Taste
  • Unlawful Carnal Gopher Knowledge

Tommy Calamari posted:

Working out which points are neighbours was far more complicated than I anticipated, so I'm pretty proud of coming up with an algorithm that does it (even though I've sinced discovered that these things are called Voronoi diagrams, and there are already far better algorithms out there). You can see that I never quite figured out the map edges.

Fortune's O(n log n) algorithm is one of my favorite algorithms of all time.

the wizards beard
Apr 15, 2007
Reppin

4 LIFE 4 REAL

That Turkey Story posted:

Yeah, seriously. I do millions of floating point operations total for the whole image.

Whoops, sorry. The first Mandelbrot renderer I ever wrote used half-broken fixed point math, I had assumed you had done something similar.

Nigger Goku
Dec 11, 2004

あっちに行け
Pretty boring compared to some of the others, but an interesting exercise in reverse-engineering. A save editor for the PSP version of Disgaea 2.


Click here for the full 706x726 image.



Click here for the full 706x1946 image.



Click here for the full 706x1416 image.


Has some cool stuff like automatic assembly/disassembly based on the structures specified, like so:
code:
class Item < BaseData
  include Structure
  
  structure(
    [:specialists,          [Specialist,8]],
    [:unknown01,            [:unknown,8]],
    [:stats,                Stats],
    [:base_stats,           Stats],
    [:item_class_id,        :int16],
    [:unknown06,            [:unknown,2]],
    [:mv,                   :int8],
    [:jmp,                  :int8],
    [:name,                 [:string,33]], 
  )
end
Sadly due to the fact that PSP saves are encrypted, with all the keys stored in firmware, it does require some loving around with custom firmware to save/load edited saves.

Edit: Bonus action shot:

Click here for the full 835x453 image.

Nigger Goku fucked around with this message at 04:06 on Jan 9, 2010

newsomnuke
Feb 25, 2007

I've finished the final feature of this scripting language I'm working on, for emitting bullets/particles/other objects, and decided to stress test it with some odd effects.

mandelbrot 1: http://www.youtube.com/watch?v=UIdPSsgwvqk (jerky due to bad encoding somehow).
mandelbrot 2: http://www.youtube.com/watch?v=ytZiE0fS58Y
particle effect: http://www.youtube.com/watch?v=A1oD94thlo8
bullet-hell stress test: http://www.youtube.com/watch?v=GC8dGIxt0ZU

These effects don't really show off the language features very well, they're more just pretty patterns. The actual language has a whole host of features for controlling the actual emitters which don't get used here. It still needs a load of optimisation, and more documentation, but I'm pretty happy with it overall.

gibbed
Apr 10, 2006

friend of the family Goku posted:

Has some cool stuff like automatic assembly/disassembly based on the structures specified, like so:
code:
class Item < BaseData
  include Structure
  
  structure(
    [:specialists,          [Specialist,8]],
    [:unknown01,            [:unknown,8]],
    [:stats,                Stats],
    [:base_stats,           Stats],
    [:item_class_id,        :int16],
    [:unknown06,            [:unknown,2]],
    [:mv,                   :int8],
    [:jmp,                  :int8],
    [:name,                 [:string,33]], 
  )
end
I would say this is not really boring, it's actually nifty. How flexible are the definitions? Can you specify data that is only present based on previous data, etc? Or is it just limited to basic definitions? I've written similar things in the past, never really happy with any of them due to limitations of having to implement project-specific cases.

Dr. Glasscock
Apr 15, 2004

HOO-DAH!!! Fatal Wiimote blow to the face, 20 points!

friend of the family Goku posted:

Awesomeness

It doesn't look very exciting and I've never played Disgaea (I know about it though), but drat that's loving awesome. So what inspired you to make this?

Dr. Glasscock fucked around with this message at 05:58 on Jan 9, 2010

Nigger Goku
Dec 11, 2004

あっちに行け

gibbed posted:

I would say this is not really boring, it's actually nifty. How flexible are the definitions? Can you specify data that is only present based on previous data, etc? Or is it just limited to basic definitions? I've written similar things in the past, never really happy with any of them due to limitations of having to implement project-specific cases.
I haven't actually tried anything more than just sequential reading/writing (the Disgaea save structure is really simple, basically just a dump of memory structures, no pointers or dynamic sizes/positions), but it reads and writes directly from a file stream (or a string pretending to be a file stream) so it'd be pretty easy to make a definition that say, reads an int32, then seeks forward or backwards to read more data. I'm actually interested in trying out some more advanced cases now, thanks for the ideas. :)

The code is up on Github, with the code related to that part of it in structure.rb and base_data.rb.

Be warned though, the code right now is very loosely-coupled and kind of bad. So far I've been focusing on getting stuff working and refactoring later, since there's a decent-enough test suite.

As for why I made this, I got laid off and had a month to work on things, and I was sick of writing CMSs for three years. :)

Edit: There's also a simple lazy-loader; since the Disgaea save structure is so simple I've made it so accessing something like
pre:
save.characters[0].items[0]
will only seek to the start of the item, instead of disassembling the entire file. The lazy-loader is really bad right now though, so I'm not exactly showcasing it.

Edit 2: irb is a godsend for reverse-engineering. Anything marked as an unknown structure can be disassembled as any data-type, and I've made a basic compare class.

Click here for the full 889x477 image.

Very easy to look at the unknown values for each character in different formats, with the game running to check and confirm things.

Nigger Goku fucked around with this message at 07:40 on Jan 9, 2010

mlnhd
Jun 4, 2002

friend of the family Goku posted:

Pretty boring compared to some of the others, but an interesting exercise in reverse-engineering. A save editor for the PSP version of Disgaea 2.

Sadly due to the fact that PSP saves are encrypted, with all the keys stored in firmware, it does require some loving around with custom firmware to save/load edited saves.


I did a save editor for FFT: War of the Lions when it first came out and I was trying to learn C#. It kind of sucks now, but it still works.
http://lioneditor.googlecode.com/svn/trunk/LionEditor/



My solution to the encrypted saves was to write a kernel plugin that overrode the normal Savedata functions to operate on plaintext:
http://lioneditor.googlecode.com/svn/trunk/FFTSaveHook/main.c

Nigger Goku
Dec 11, 2004

あっちに行け

Melonhead posted:

My solution to the encrypted saves was to write a kernel plugin that overrode the normal Savedata functions to operate on plaintext:
http://lioneditor.googlecode.com/svn/trunk/FFTSaveHook/main.c

Oh awesome! Is that just something you can compile and chuck in the CFW plugins folder? I'm using a plugin called SGDeemer that dumps and loads unencrypted saves, but it's slow and seems to not actually save sometimes, so I'm not too happy with it.

SlightlyMadman
Jan 14, 2005

I'd been trying to put together a zombie survival game for years, but always managed to get hung up on making the graphics fancy. I finally decided the other day that graphics can gently caress off, and I'm starting it over as an ASCII roguelike, using The Doryen library.

I also decided to take the game in a new direction and make it more of an end-of-the-world survival scenario than a pure zombie apocalypse. Sure, there will still be plenty of zombies, but there will be other challenges as well to keep it interesting.



Working title is PTOTL or "Will the last one out please turn off the lights?"

Contero
Mar 28, 2004



I've always wanted to write an app like this. You can just type whatever python code you want into the text box and press the run button.

tripwire
Nov 19, 2004

        ghost flow

Contero posted:



I've always wanted to write an app like this. You can just type whatever python code you want into the text box and press the run button.

Awesome!!! For the longest while I was trying to figure out how to set up a surface I could draw to interactively from within a pyqt window and I eventually gave up and settled on drawing to pngs on disk. Is there any way I could see your source code?

Adbot
ADBOT LOVES YOU

Contero
Mar 28, 2004

tripwire posted:

Awesome!!! For the longest while I was trying to figure out how to set up a surface I could draw to interactively from within a pyqt window and I eventually gave up and settled on drawing to pngs on disk. Is there any way I could see your source code?

It's actually not pyqt. I'm embedding the python interpreter into my C++ Qt program and using Boost::Python to expose functions to it. When I hit run it grabs the code from the editor and sends it to python:

code:
boost::python::exec(edit->document()->toPlainText().toLocal8Bit().constData(), nspace);
As for creating the surface, you might be able to replicate what I did in C++, which was to draw to an off-screen QImage, then once you want to swap buffers call setPixmap on your QLabel which is actually what's being displayed.

code:
// imageView is a QLabel, image is a QImage. I was testing out drawing to a larger QImage and then scaling down to reduce aliasing.
imageView->setPixmap(QPixmap::fromImage(image->scaled(640, 480, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
I spent a lot of time scratching my head trying to figure out how to display a QImage as a simple widget. It's not exactly straightforward.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply