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
Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

ijustam posted:

I've owned this thing for 4 years and kept it through 3 moves and I finally got around to doing something with it.

https://www.youtube.com/watch?v=8mHXzukItVk

Now to figure out what exactly to utilize it for.
Attach it to a smell detector, and use it as a warning indicator for anyone thinking about using the main restroom.

Alternatively, find a discreet wireless remote you can operate blind, and try and convince people you've created said device. Or a device that detects burned cooking. Or a device that detects lies. Etc.

Programmer Humor posted:

Trying to make some trees. At first I thought I could model them on my own but ultimately I made a python script to have them procedurally generated in blender.


Look up l-systems, if you want to take that further. You can use them to generate trees that look extremely realistic, entirely procedurally (aside from entering their "DNA", which is purely logical/programmers can do it).

Shalinor fucked around with this message at 00:02 on Oct 11, 2014

Adbot
ADBOT LOVES YOU

Hubis
May 18, 2003

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

ijustam posted:

I've owned this thing for 4 years and kept it through 3 moves and I finally got around to doing something with it.

https://www.youtube.com/watch?v=8mHXzukItVk

Now to figure out what exactly to utilize it for.

A giant, low-resolution thermometer/weather station display

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Hubis posted:

A giant, low-resolution thermometer/weather station display

"Hot"
"Less hot"
"Too cold"

Programmer Humor
Nov 27, 2008

Lipstick Apathy

Shalinor posted:

Look up l-systems, if you want to take that further. You can use them to generate trees that look extremely realistic, entirely procedurally (aside from entering their "DNA", which is purely logical/programmers can do it).

Looks interesting, thanks.

Jo
Jan 24, 2005

:allears:
Soiled Meat
I get really excited over stupid ideas and it takes me a long time to realize they're stupid.


Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.

Jo posted:

I get really excited over stupid ideas and it takes me a long time to realize they're stupid.



Perplexing resume fodder. Does it paste the face over yours automatically or do you have to interact with it?

Jo
Jan 24, 2005

:allears:
Soiled Meat

Newf posted:

Perplexing resume fodder. Does it paste the face over yours automatically or do you have to interact with it?

It's automatic. Really just an excuse to play with the FaceDetection API.

steckles
Jan 14, 2006




Been working on an old school 2.5D fps engine the past few weekends. It's a ray caster, so I guess that makes it more closely related to Wolfenstein 3D's engine than the Doom or Build engines. It supports sloped floors and ceilings, sector over sector, and overlapping space so any vanilla Doom, Build, or Marathon engine level geometry should be supported by it.

It's been pretty fun to work on so far. The part giving me the most trouble has been collision detection rather than the rendering engine.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Jo posted:

I get really excited over stupid ideas and it takes me a long time to realize they're stupid.


This is cool. I like how it makes you look like a tech guy with glasses.

EDIT: VV That's a good point, maybe use virtual lighting? Also the scale on the head is all wrong, which is disappointing.

Shalinor fucked around with this message at 03:56 on Oct 12, 2014

Jo
Jan 24, 2005

:allears:
Soiled Meat

Shalinor posted:

This is cool. I like how it makes you look like a tech guy with glasses.

I gotta' work on the blending. Notice how the image on the left lost a bunch of the original vibrance.

clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe
Before:


After:


Friend makes a request I deliver, though, it's not nearly as cool as replacing it with skeletons like I've seen.


Also it turns "Social Justice Mage" into "Social Justice [random class name]"

Jo
Jan 24, 2005

:allears:
Soiled Meat

steckles posted:




Been working on an old school 2.5D fps engine the past few weekends. It's a ray caster, so I guess that makes it more closely related to Wolfenstein 3D's engine than the Doom or Build engines. It supports sloped floors and ceilings, sector over sector, and overlapping space so any vanilla Doom, Build, or Marathon engine level geometry should be supported by it.

It's been pretty fun to work on so far. The part giving me the most trouble has been collision detection rather than the rendering engine.

:allears: BUILD or not, I am Ken Silverman's bitch when it comes to 2.5D games. Have you made the map editor, too, or are you just using levels from Marathon/Duke3D/Doom?

steckles
Jan 14, 2006

Jo posted:

:allears: BUILD or not, I am Ken Silverman's bitch when it comes to 2.5D games. Have you made the map editor, too, or are you just using levels from Marathon/Duke3D/Doom?
The floor and ceiling geometry is imported from .obj models that meet very specific requirements. Walls are determined by the sector edges and the difference in height between each edge and its neighbours, if it has any. I modelled everything in Wings and textured it "in-game".

Optimization has been an interesting task; Modern CPUs are such FP monsters that the limiting factor in engine performance isn't rendering the level, it's writing the pixels to the framebuffer. If I could get SDL to give me a screen surface ordered in columns rather than rows, it'd probably double the frame rate.

Spatial
Nov 15, 2007

steckles posted:

Optimization has been an interesting task; Modern CPUs are such FP monsters that the limiting factor in engine performance isn't rendering the level, it's writing the pixels to the framebuffer. If I could get SDL to give me a screen surface ordered in columns rather than rows, it'd probably double the frame rate.
That's pretty much always been the bottleneck. John Carmack went to great lengths to have near-zero overdraw in Doom and Quake precisely for that reason.

Hubis
May 18, 2003

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

steckles posted:

The floor and ceiling geometry is imported from .obj models that meet very specific requirements. Walls are determined by the sector edges and the difference in height between each edge and its neighbours, if it has any. I modelled everything in Wings and textured it "in-game".

Optimization has been an interesting task; Modern CPUs are such FP monsters that the limiting factor in engine performance isn't rendering the level, it's writing the pixels to the framebuffer. If I could get SDL to give me a screen surface ordered in columns rather than rows, it'd probably double the frame rate.

Do what modern GPUs do and output in a "block-linear" pattern. Instead of going horizontally (bad for reuse):

WWWW
XXXX
YYYY
ZZZZ

Or vertically (bad for write combining):
WXYZ
WXYZ
WXYZ
WXYZ

DO a combination of the both:

WWXX
WWXX
WWXX
WWXX
YYZZ
YYZZ
YYZZ
YYZZ

(where the number of outputs you do along a given "row" is determined by your memory architecture. You can just experiment with it).

steckles
Jan 14, 2006

Hubis posted:

Do what modern GPUs do and output in a "block-linear" pattern....
Yeah, I was considering something like that. Although, I'm not entirely sure how I'd go about doing it given the nature of the rendering algorithm.

shodanjr_gr
Nov 20, 2007

steckles posted:

Yeah, I was considering something like that. Although, I'm not entirely sure how I'd go about doing it given the nature of the rendering algorithm.

From what I recall from reading relevant articles, the ray casting for build-style engines works by ray casting once per column of pixels then figuring out the hit and calculating the extent of the wall surface based on perspective projection. You could do something along the lines of caching hits for each column then determining the color values on a row-by-row basis in a second pass. Or dump everything into an OpenGL texture and upload once per frame for display...

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I don't know anything about 3D engines. Why is a column of pixels a better format for you to work with?

steckles
Jan 14, 2006

shodanjr_gr posted:

From what I recall from reading relevant articles, the ray casting for build-style engines works by ray casting once per column of pixels then figuring out the hit and calculating the extent of the wall surface based on perspective projection. You could do something along the lines of caching hits for each column then determining the color values on a row-by-row basis in a second pass. Or dump everything into an OpenGL texture and upload once per frame for display...
I think Doom did something like this with floors where their extents were first calculated in columns and then the list of columns were converted to spans. This let them reuse the dreaded 1/z needed for texture mapping too.

Suspicious Dish posted:

I don't know anything about 3D engines. Why is a column of pixels a better format for you to work with?
The ray casting algorithm computes the view of the world one column of pixels at a time. In my case, the renderer output pixels like so:
code:
01 06 11 16
02 07 12 17
03 08 13 ...
04 09 14
05 10 15
But the SDL surface that gets sent to the video card is ordered in the opposite way:
code:
01 02 03 04 
05 06 07 08
09 10 11 12
13 14 15 16
17 18 ...
This causes trouble for the CPU, because it's always unlikely to have the parts of the surface that we would want to write to in cache.

The renderer also has a double sized mode for extra-old-school goodness. Changing the order that the double sized framebuffer gets copied to the surface from this:
code:
for(int i=0;i<framebuffer_w;i++)
	for(int j=0;j<framebuffer_h; j++)
to this:

code:
for(int j=0;j<framebuffer_h; j++)
	for(int i=0;i<framebuffer_w;i++)
resulted in an average 70% increase in frame rate. I think this is because both the entire smaller framebuffer and large, relevent parts of the SDL surface could be kept in cache at once.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Right, I was just curious why the rasterizer was emitting pixels in columns rather than rows.

One Eye Open
Sep 19, 2006
Am I awake?
Why not draw the image in an SDL surface rotated 90 degrees so you do have contiguous pixels, then blit it to the display using the (AFAIK) graphic hardware accelerated SDL_RenderCopyEx with the angle set to return it to upright?

steckles
Jan 14, 2006

One Eye Open posted:

Why not draw the image in an SDL surface rotated 90 degrees so you do have contiguous pixels, then blit it to the display using the (AFAIK) graphic hardware accelerated SDL_RenderCopyEx with the angle set to return it to upright?
Interesting, I not super familiar with the SDL_renderer stuff in SDL2. I'll take a look a closer look at it.

shodanjr_gr
Nov 20, 2007

steckles posted:

This causes trouble for the CPU, because it's always unlikely to have the parts of the surface that we would want to write to in cache.

That's important but I would think that if you are depositing computed color values directly into the frame buffer via whatever blitting API SDL gives you, chances are you are losing the vast majority of your performance to driver/window system overhead and there's no reason to do that (unless of course you're trying to stay close to the "old-school" way of implementing such an engine). What's your performance like if you compute the entire frame and just give the full thing to your window toolkit for presentation?

steckles
Jan 14, 2006

shodanjr_gr posted:

What's your performance like if you compute the entire frame and just give the full thing to your window toolkit for presentation?
That's what I do already. Pixels are written directly into the surface's pixel memory and then sent out all at once using SDL_flip. When profiling, the single "busiest" line in the program is the one that puts the computed colour into the surface. The line isn't even complicated, just some simple pointer math. Depending on what's being rendered, up to 50-60% of the samples in the profiler are on that single line.

Performance isn't terrible as is, it manages well over 100 fps at 1280x720.

steckles fucked around with this message at 00:08 on Oct 16, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
https://magcius.github.io/xplain/article/composite.html

Just spent the evening writing this article. It's half-done, but it's already getting a bit too long I think. Was it understandable, did it make sense?

If you're missing context, try reading the first other few articles in the series: https://magcius.github.io/xplain/article/

hendersa
Sep 17, 2006

Texas Instruments just did a project spotlight blog post on BeagleSNES:

http://e2e.ti.com/group/launchyourdesign/b/blog/archive/2014/10/16/project-spotlight-beaglesnes.aspx

I spent some time fighting with the device tree overlays for the 3.17 kernel to try and get HDMI audio to turn on for the BeagleBone Black. Much swearing has been going on. My kernel codebase is a Frankenstein-like mess of patches, and trying to get all the pieces playing with each other isn't the straightforward bit of engineering that I'd like it to be. But, if I can get this thing limping along, I can finally get some OpenGL ES support going. Finally. I also got ADB working for my BBBAndroid distro and am being asked for wi-fi support and accelerated OpenGL ES. It never ends!

I looked at adding a BBB target for EGL to SDL2, but for now I think that I'll have the OpenGL ES support by initializing the framebuffer with SDL 1.2 and then calling the vendor-specific functions to create a framebuffer EGL context to render to. It'll be messy, but initial testing looks promising.

I also just wrapped up writing another chapter on a BeagleBone Black book that I've been working on. :ssh:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I made a higher quality GIF replacement. I'm looking for cool source material to encode.

Hyvok
Mar 30, 2010

Suspicious Dish posted:

I made a higher quality GIF replacement. I'm looking for cool source material to encode.



Sounds quite a lot like this: http://imgur.com/blog/2014/10/09/introducing-gifv/

Jewel
May 2, 2009


GIFV is basically just a HTML5 canvas playing an mp4 whereas Suspicious Dish works on Something Awful as a pure [img] if you didn't see (because it's an SVG with some tomfoolery hacked together to make it play animations streamed from jpgs)

Edit: vvv High level description more like belongs in the trash.

Jewel fucked around with this message at 09:37 on Oct 18, 2014

glompix
Jan 19, 2004

propane grill-pilled
That is loving radical. Based on the high level description by Jewel above, I like that better than gifv. Why play mp4 on a canvas when you can just embed the mp4 as video? (or extend video somehow if needed)

edit: Yeah, I don't "get" gifv. In Chrome the gifv is pretty choppy for me sometimes, but this jsfiddle of a video tag works fine for the same purpose. http://jsfiddle.net/ok76v0p8/

glompix fucked around with this message at 09:39 on Oct 18, 2014

ATM Machine
Aug 20, 2007

I paid $5 for this

Suspicious Dish posted:

I made a higher quality GIF replacement. I'm looking for cool source material to encode.



I like how you can custom set durations on each frame in the markup and I'm tempted to write something that randomly scrambles the begin values and adds an assortment of styling rules to the image tags themselves.

Heck, seeing as it's SVG you could probably use it as a way to add text and witty subtitles to it easier as well.

ufarn
May 30, 2009

Suspicious Dish posted:

I made a higher quality GIF replacement. I'm looking for cool source material to encode.


Gamersyde has HQ videogame videos, if that works: http://www.gamersyde.com. YouTube streamers Jackfrags and Frankie tend to upload videos in 4K as well.

I guess Star Citizen would make for some decent videos.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Suspicious Dish posted:

I made a higher quality GIF replacement. I'm looking for cool source material to encode.


Seems to have some issues on Chrome:

ufarn
May 30, 2009

SupSuper posted:

Seems to have some issues on Chrome:


For some reason, it works, when it's quoted, but not when displayed directly.

img vs. timg:





Scrolling the page messes slightly with the timg, but not as much as the img.

Top Quark
Aug 2, 2010

"Going where no man has gone before."
Those both look exactly the same for me. No issues with the first one posted either.

Chrome Version 37.0.2062.124 m

e: I take that back! Now it's doing the error thing all of a sudden. Weeeeeird.

Voronoi Potato
Apr 4, 2010
mine only works correctly when all the images in view are the same size. might have to do with the amount of animated svgs on the page??

RoboCicero
Oct 22, 2009

Suspicious Dish posted:

I made a higher quality GIF replacement. I'm looking for cool source material to encode.


If you're still looking for stuff to encode you really can't go wrong with https://vimeo.com/79098420 and any of the animations where the AI robots are trying how to walk (0:55 onwards) would be incredible looping.

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

Suspicious Dish posted:

I made a higher quality GIF replacement. I'm looking for cool source material to encode.



This is extremely clever. I want to know more about your encoder.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
ffmpeg to convert the video into an image sequence, then I go into the directory and delete the frames that don't matter. Then I run imagemagick over them to compress them to some quality that looks good. Then I run a custom .py file which I modify by hand to give it the width/height and frames. After that, I run it through gzip to get the final compressed file. Here's the one for distance.xng.

Python code:
import base64
import mimetypes
import json

SVG_TEMPLATE = """<svg xmlns="http://www.w3.org/2000/svg" xmlns:A="http://www.w3.org/1999/xlink" width="%(width)d" height="%(height)d">%(images)s%(sets)s</svg>"""

IMAGE_TEMPLATE = """<image id="%(id)s" width="100%%" height="100%%" A:href="%(url)s" visibility="hidden"/>"""
SET_TEMPLATE = """<set A:href="#%(id)s" id="A%(id)s" attributeName="visibility" to="visible" dur="%(dur)s" begin="%(begin)s"/>"""

SIZE = 640, 360
WIDTH, HEIGHT = SIZE

frames = []
DELAY = 1000 / 30
for i in xrange(1, 291):
    frames.append(dict(file="%06d.jpg" % (i,), delay=DELAY))

def frame_id(frame):
    return frame['file'].rsplit('.', 1)[0]

image_strs = []
set_strs = []
for i, frame in enumerate(frames):
    mimetype, encoding = mimetypes.guess_type(frame['file'])
    data = base64.b64encode(open(frame['file'], 'rb').read())
    url = 'data:%s;base64,%s' % (mimetype, data)
    id = frame_id(frame)

    last_frame = frames[i - 1]
    begin = 'A%s.end' % (frame_id(last_frame,))
    if i == 0:
        begin += '; 0s'

    dur = '%dms' % (frame['delay'],)

    ctx = dict(id=id, width=WIDTH, height=HEIGHT, url=url, begin=begin, dur=dur)
    image_strs.append(IMAGE_TEMPLATE % ctx)
    set_strs.append(SET_TEMPLATE % ctx)

svg = SVG_TEMPLATE % dict(width=WIDTH, height=HEIGHT, images=''.join(image_strs), sets=''.join(set_strs))

print svg

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
You're on HackerNews!

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