code logs -> 2012 -> Tue, 26 Jun 2012< code.20120625.log - code.20120627.log >
--- Log opened Tue Jun 26 00:00:18 2012
00:15 io|gone is now known as iospace
00:19 You're now known as TheWatcher[T-2]
00:24 You're now known as TheWatcher[zZzZ]
00:32 * McMartin grumbles a little at 4clojure.
00:37
<@ToxicFrog>
4clojure annoys me because it seems to expect to be paired with something but doesn't say what
00:38
<&McMartin>
Yeah, also, it wants to inline everything.
00:38
<@ToxicFrog>
Also the "your entire solution must fit in this slot, no external lets or defns" gets damn annoying in some questions.
00:38
<&McMartin>
Quite so.
00:38 * McMartin did the fibonacci one (#26?) earlier today.
00:38
<@ToxicFrog>
I wondered if it was that one~
00:39
<&McMartin>
I did that one with an infinite lazy seq and then "take n", which *really should not be done with lets*
00:40
<&McMartin>
Also, 4clojure's repl doesn't allow bigint literals (???)
00:41
<&McMartin>
Here's my Real Answer, which 4clojure doesn't like
00:41
<&McMartin>
(def fibs
00:41
<&McMartin>
(let [aux (fn aux [a b]
00:41
<&McMartin>
(lazy-seq
00:41
<&McMartin>
(cons b (aux b (+ a b)))))]
00:41
<&McMartin>
(aux 0N 1N)))
00:42
<&McMartin>
(protip: don't type 'fibs' into a repl after defining it~)
00:43
<&McMartin>
That said, letfn lets you more or less treat the inline as a file.
00:43
<&McMartin>
But letfn is ugly. =(
01:08
<@ToxicFrog>
Hmm
01:08
<@ToxicFrog>
I vaguely recall a command-line linux tool that popped up a dialog box for filling in command line options
01:09
<@ToxicFrog>
So you could make a nice frontend for something using, say, 'grep $(ask-for-some-options ...)'
01:09
<@ToxicFrog>
But now I can't remember what it was called.
01:19
<@ToxicFrog>
(it wasn't zenity, that only asks one thing at a time)
01:21
< Tarinaky>
Python question.
01:21
< Tarinaky>
If I want to implement an enumerated type.
01:22
< Tarinaky>
What's the proper way of doing it?
01:22
< Tarinaky>
String literals?
01:22
<&McMartin>
It's most common to have members of a namespace - see the Element constants in xml.minidom
01:22
< Tarinaky>
Or should I assign object() to my constant's name?
01:22
< Tarinaky>
Is '==' done by pointer or otherwise for such an object?
01:23
<&McMartin>
Well, you will usually also want some kind of serialized form - they're integers in xml.minidom to track libxml2, IIRC.
01:27
<&McMartin>
== is done via __equ__ or whatever its name is
01:28
< Tarinaky>
What's its default behavior?
01:43 Derakon is now known as Derakon[AFK]
01:57 Kindamoody[zZz] is now known as Kindamoody
02:02 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
02:09 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
02:09 mode/#code [+o ToxicFrog] by ChanServ
--- Log closed Tue Jun 26 02:23:40 2012
--- Log opened Tue Jun 26 02:23:49 2012
02:23 TheWatcher[zZzZ] [chris@Nightstar-3762b576.co.uk] has joined #code
02:23 Irssi: #code: Total of 27 nicks [6 ops, 0 halfops, 0 voices, 21 normal]
02:23 mode/#code [+o TheWatcher[zZzZ]] by ChanServ
02:24
< Tarinaky>
Hmm. I seem to have deeper bugs still.
02:24 Irssi: Join to #code was synced in 44 secs
02:26 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has joined #code
02:26 mode/#code [+o Vash] by ChanServ
02:31 * ToxicFrog has a moment of confusion quickly turning to horror as he realizes that in Python, List.append(x) modifies the list in-place and returns None
02:31
< Tarinaky>
Hmm. No. Works..
02:31
<@ToxicFrog>
Tarinaky: as a rule, PRNGs all start up with a fixed seed, usually 0.
02:31
<@ToxicFrog>
Python's is no exception.
02:32
<&McMartin>
Or, in C's case, 12345 -_-
02:32
<&McMartin>
("That's the kind of code an idiot would put on his luggage!")
02:34
< Tarinaky>
ToxicFrog: It's giving me different results now.
02:34 * Tarinaky is pretty sure that python's 'random' starts seeded with None.
02:34
< Tarinaky>
None being "random seed".
02:35
< Tarinaky>
>.>
02:36 Attilla [Obsolete@Nightstar-fcd97f92.as43234.net] has quit [Ping timeout: 121 seconds]
02:45
<@ToxicFrog>
Oh god, how do I append to a list without modifying it in place
02:45
<@ToxicFrog>
aaaaaaaa
02:45
<~Vornicus>
b = a + [item]
02:46
<@ToxicFrog>
and why in god's name do append() and extend() return None
02:46
<~Vornicus>
What else would they return?
02:47
<~Vornicus>
They can't return the list - that would suggest they aren't in place.
02:47
<@ToxicFrog>
Also
02:47
<@ToxicFrog>
print args: ['-d', 'MY_DOMAIN', '-g', '1024x768', '-z', '-u', '', '-p', '', '']
02:47
<@ToxicFrog>
os.execvp(command, args): TypeError: execv() arg 2 must contain only strings
02:48
<~Vornicus>
that one I don't get
02:48
<~Vornicus>
maybe it wants only non-empty strings. I don't know.
02:50 * Vornicus thinks
02:51
<~Vornicus>
...no, C's main() takes argc and argv, so you don't do list-end testing via null termination, that doesn't make sense
02:52
<@ToxicFrog>
Also, I get the same error even if all of the strings are nonempty.
02:52
<~Vornicus>
Weird.
02:53
<~Vornicus>
try os.execvp(command, *args) instead; it might be doing this via packing/unpacking.
02:53
<@ToxicFrog>
And here is the result of mapping it over type(): [<type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>, <type 'str'>]
02:54
<@ToxicFrog>
Yeah, that works
02:54
<~Vornicus>
(this is the same as os.execvp(command, "-d", "MY_DOMAIN", "-g"....
02:55
<@ToxicFrog>
(yeah, I do know that much python :P )
03:02 * Tarinaky blinks.
03:02
< Tarinaky>
Okay. I have a bug here.
03:02
< Tarinaky>
I want engaging in combat to 'halt' a ship's movement.
03:02
< Tarinaky>
Hang on.
03:02
< Tarinaky>
I think I might have done something stupid here.
03:03
< Tarinaky>
No, okay.
03:03
<@Alek>
do you mean "pause" while it's in combat, then continue on its way?
03:03
<@Alek>
or just full stop?
03:03
< Tarinaky>
Full stop. Cannot move for the rest of the turn.
03:03
< Tarinaky>
Okay.
03:03
<@Tamber>
Okay?
03:03
< Tarinaky>
So all ships start with self.end_of_turn = False.
03:04
< Tarinaky>
When combat happens, ships get self.end_of_turn = True
03:04
< Tarinaky>
But when it comes to check if self.end_of_turn ... it just skips straight over...
03:04
< Tarinaky>
What?
03:05
<@Alek>
...
03:05
<@Alek>
can I see that piece of code in context?
03:05
< Tarinaky>
Yes, but it's a reallly big function.
03:07
< Tarinaky>
https://github.com/Tarinaky/DuelFieldStars/blob/master/duelfieldstars/model/ship .py 'do_microtick' and 'resolve_combat'.
03:09
<@ToxicFrog>
Oh man, some programs behave really amusingly (and generate extremely confusing error messages) if argv[0] != command
03:12
< Tarinaky>
Derp
03:12
< Tarinaky>
Found it.
03:12
<@Alek>
ah, python.
03:12
<@Alek>
and it behaves differently from the languages I do know. XD
03:13
<@Alek>
so what was it? so I know. <_<
03:14
< Tarinaky>
Nope... Still having the same issue :/
03:15
< Tarinaky>
Or maybe it is.
03:17
<@Alek>
huh.
03:18 * Alek doesn't know how python treats true/false decisions on stuff like ifs, but that bit's nagging at him.
03:18
<@Alek>
if ship.end_of_turn:
03:18
<@Alek>
continue
03:18
<@Alek>
that bit, to be precise.
03:18 * Alek shrugs, goes to bed.
03:20
< Tarinaky>
Alek: https://github.com/Tarinaky/DuelFieldStars/commit/6fd3889f5c844e131de833513e3cc9 17fade1aae if you still care.
03:27
<@Alek>
ah, ships in fleets had to set separately? XD
03:27 * Alek shakes head.
03:28
<@Alek>
just remember that part if you ever make any more changes to ship organization. or ship statuses. XD
03:30
< Tarinaky>
It was only setting for the nth ship, but not where n = 1.
03:31
< Tarinaky>
But I was only testing n = 1.
03:31
< Tarinaky>
Anyway, I should sleep. I added a whole 1 more feature \o/
03:38
< Rhamphoryncus>
Bah. You ask a channel full of geeks about selling magic cards, you expect to at least get a bite x_x
03:39 * rms is broke
03:40 * ToxicFrog only plays draft these days
03:44
< Rhamphoryncus>
It wasn't this channel. I was hoping to avoid shipping it anywhere
04:03 SmithKurosaki [smith@Nightstar-1748d158.home1.cgocable.net] has joined #code
04:03 iospace is now known as iospacedout
04:04 * Tarinaky can't sleep :/
04:20 SmithKurosaki [smith@Nightstar-1748d158.home1.cgocable.net] has quit [Operation timed out]
04:22 Noah [nbarr@Nightstar-9368be0f.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
04:24
< Tarinaky>
I think I need some stats help.
04:25
< Tarinaky>
Which is, objectively, better. A single event with certainty or two events with 50% frequency?
04:25
< Tarinaky>
The events being of the same value.
04:25
< Tarinaky>
Consider the idiom "a bird in hand is better than two in the bush" >.>
04:27 Derakon[AFK] is now known as Derakon
04:27
<@Tamber>
The latter, I think. You're getting 1*(value) at least 50% of the time, 2*(value) 25% of the time. (But 0 for the remaining 25%) At least, I *think*. I could be wrong.
04:27
<&Derakon>
In the first case your value is 1.
04:27
<@Tamber>
(But then, I didn't do so well with statistics, so shovelful of salt requires~)
04:28
<@Tamber>
required, even. ??
04:28
<&Derakon>
In the latter case, one quarter of the time you get nothing, one quarter of the time you get value 2, and half the time your value is 1.
04:28
<&Derakon>
So your average value is (0 + 1 + 1 + 2) / 4 = 1.
04:29
< Tarinaky>
Does it change if it's A vs A/2?
04:30
<&Derakon>
You mean the values of the events in the respective cases?
04:30
< Tarinaky>
Yes.
04:30
<&Derakon>
If the values of the events in the "two 50% events" are lower, then you'd rather have certainty.
04:30
<&Derakon>
If the values are higher, then you'd rather take your chances.
04:30
< Tarinaky>
I mean if the certainty is reduced as well.
04:30
< Tarinaky>
So instead of certainty the probability is A
04:31
<&Derakon>
Same effect as raising the chancy one.
04:31
< Tarinaky>
and the two events have A/2
04:31
<&Derakon>
Oh, I see.
04:31
<&Derakon>
Don't think that changes anything.
04:32
< Tarinaky>
Considering allowing 'hit chances' in excess of 100% turn into two seperate hits at lower chance.
04:32
<&Derakon>
Chance of getting nothing is (1 - A) ^ 2; chance of getting double is A ^ 2, chance of getting only one is 2 * A * (1 - A).
04:33
<&Derakon>
I'll let you sort that out.
04:33
< Tarinaky>
Would it be fair to say that if at 100% - epsilon you have one attack at 100%-epsilon chance...
04:34
< Tarinaky>
And if you have a 100% + epsilon chance it's turned into two hits at 100% + epsilon /2...
04:34
< Tarinaky>
That 100% + epsilon is better?
04:34
< Tarinaky>
Would it be better to convert 100% + B into certainty + a second hit at B?
04:34
<&Derakon>
Two hits at 100% + X, where X is positive, is better than one hit at 100% - X, where X is negative.
04:35
<&Derakon>
I would suggest, if you want to reward overshooting on hit chance, that you make it "you get one hit guaranteed, and a second hit at odds (your hit chance - 100)".
04:35
< Tarinaky>
They'd be two hits each at 50% + X/2
04:35
< Tarinaky>
Right.
04:35
<&Derakon>
...use parentheses then.
04:35
<&Derakon>
So e.g. 120% means "100% chance of 1 hit, 20% chance of second hit".
04:35
< Tarinaky>
I'm typing in an uncomfy pose, parans are hard.
04:36
<&Derakon>
Then change your pose.
04:36
<&Derakon>
You're the one asking for help here; it behooves you to be clear.
04:36
< Tarinaky>
Yeah, I know. Sorry :p
04:39 * McMartin finishes the first 50 4clojure problems.
04:41 Derakon is now known as Derakon[AFK]
04:59
<~Vornicus>
Tarinaky: it depends on what you're going for.
05:01
<~Vornicus>
The expected value is the same, of course, but if the number of events required for a complete success is quite small but not 1, then you may be better off with the dicey proposition. Let me play for you the song of m^W^W^W^W^W^W^W make some graphs.
05:07
<~Vornicus>
Mmm, okay. actually I was wrong.
05:07
<~Vornicus>
The higher the number of events required, the better off you are choosing the risky proposition
05:08
<~Vornicus>
...sort of.
05:09
<~Vornicus>
approaching 50% of the time, you're punching above your weight with the riskier one. Not /much/ above your weight, generally, but. On the other hand approaching 50% of the time you're punching below it.
05:13
<~Vornicus>
Really what it does (in a punchout contest) is move the risk of failure somewhat towards 50-50: if you'd likely lose using the certain one, you're better off using the risky one; and if you'd likely /win/ using the certain one, you should stick with it.
05:21 himi-cat [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
05:29 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
05:29 mode/#code [+o himi] by ChanServ
05:37 Kindamoody [Kindamoody@Nightstar-05577424.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
05:38 Kindamoody|afk [Kindamoody@Nightstar-05577424.tbcn.telia.com] has joined #code
05:38 mode/#code [+o Kindamoody|afk] by ChanServ
05:38 Kindamoody|afk is now known as Kindamoody
05:48 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
05:51 * McMartin blows through a few more 4clojure things
05:51
<&McMartin>
I should really be playing with Light Table here.
05:54 * Vornicus decides to try out game maker again. Sees they have a new thing "game maker studio"
05:55
<&McMartin>
That looks like it's mostly for actual semi-pro if not fully pro devs.
06:00 Derakon[AFK] is now known as Derakon
06:18
< Tarinaky>
Mylyn for Eclipse is quite good now I got it working btw.
06:35 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
06:45 Kindamoody is now known as Kindamoody|out
06:49 Derakon is now known as Derakon[AFK]
07:20
< Rhamphoryncus>
Hey, if you change general.smoothScroll.mouseWheel.durationMinMS to 20 then scrolling is actually pretty decent in firefox
07:22
< Rhamphoryncus>
going slow is still a little jerky as it switches back and forth between fast and slow modes. I couldn't figure out a combination that allowed slow properly without unacceptable lag for fast scrolling
07:24 * McMartin grabs light table demo
07:32 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Client closed the connection]
07:56
< froztbyte>
http://generalassemb.ly/cs-for-hackers/
07:56
< froztbyte>
oh if I was in the states...
08:05 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
09:11 You're now known as TheWatcher
09:16
<&McMartin>
OK, yeah. The 4clojure stuff is really bad as a teaching tool.
09:16
<&McMartin>
The material is in no sensible order and doesn't really present things meaningfully.
10:14 Attilla [Obsolete@Nightstar-fcd97f92.as43234.net] has joined #code
10:27 * McMartin gets far enough into 4clojure to start seeing heavily recycled Project Euler problems.
10:27 * McMartin -_-s and half-assedly ports his Haskell solutions.
10:30 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
10:30 mode/#code [+o himi] by ChanServ
11:05 * TheWatcher finds himself in the position of having to actually draw out the status and history of his Mornington Crescent Tagging game to keep track of it
11:36 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
11:46
< Tarinaky>
TheWatcher: Has anyone tried a Lateral Guildford Maneuver?
11:46 iospacedout is now known as iospace
12:04 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
12:04
<@TheWatcher>
Tarinaky: no, although one project has attempted Abercrombie's Double-Circle Feint.
12:11 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
12:11 mode/#code [+o himi] by ChanServ
13:02 iospace is now known as io|driving
13:26
<@ToxicFrog>
McMartin: let me know what you think of Light Table
13:26
<@ToxicFrog>
As far as I can tell it's a lisp-specific, engine-specific, game development IDE, and I can't figure out why everyone is so excited about it
13:31 Reivthia [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
13:38 Orthia [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
13:46 Orthia [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
13:47 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has joined #code
14:00 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
14:00
< Rhamphoryncus>
7 o'clock and all's WTF did I wake up this early?!
14:02
<@TheWatcher>
Clowns.
14:02 * TheWatcher nods sagely
14:03
< Rhamphoryncus>
Indeed. I should have suspected them.
14:10
< celticminstrel>
Hm. Would it be better to have one vertex array per level and clip it to the viewport, or have a vertex array the size of the viewport and update the texture coordinates as the view shifts?
14:15
< Rhamphoryncus>
This is a VAO+VBO?
14:15
< Rhamphoryncus>
How big is it?
14:16
< celticminstrel>
The viewport is 800x600; smaller in edit mode since there's edit controls taking up part of the screen.
14:17
< Rhamphoryncus>
I mean the VBO :)
14:17
< celticminstrel>
Actually the viewport while playing isn't quite as large either since 600 isn't a multiple of 32.
14:17
< celticminstrel>
So um...
14:17 * celticminstrel grabs calculator.
14:17
< Rhamphoryncus>
How many vertices, what is the per-vertex data?
14:18
< celticminstrel>
1800 vertices if I only do the viewport area.
14:18
< celticminstrel>
Could be a lot more if I do the whole level; a few of the levels are up to nine times as large as the screen.
14:20
< Rhamphoryncus>
If that's x/y/z floats then 1800*3*4=21600. Assuming a 256 MiB graphics card then you're looking at 0.01%. If it's 10 times more than 0.1%. Tiny, just use one :)
14:21
< celticminstrel>
So, whole level and then clip.
14:21
< Rhamphoryncus>
Yeah, but the next question is how you'll clip.
14:22
< celticminstrel>
Yes, I was thinking the same thing.
14:22
< Rhamphoryncus>
The lazy way is let opengl clip for you when it sees they're outside the view frustrum (the 3d "box" that the viewport sees)
14:24
< Rhamphoryncus>
It's not a terribly large amount of vertices but that's still an ugly way to do it. Save that for triangles that are actually close to the view frustrum
14:24
< celticminstrel>
What's ugly? Letting OpenGL clip for me?
14:24
< Rhamphoryncus>
yes
14:25
< Rhamphoryncus>
It'll send all the vertices through the vertex shader, then drop them before they hit the fragment shader
14:25
< celticminstrel>
The viewport for the level isn't the entire window in any case; there's a status bar at the bottom.
14:26
< Rhamphoryncus>
That's fine. Just change the depth mode and draw that after
14:26 io|driving is now known as iospace
14:26
< celticminstrel>
Huh? Change the depth mode?
14:27
< Rhamphoryncus>
Are you using a depth buffer?
14:27
< celticminstrel>
I dunno. Should I be mentioning that this is all 2D and the vertex array is a tilemap?
14:27
< Rhamphoryncus>
I was going to ask about the second one :)
14:28
< Rhamphoryncus>
2d often uses a depth buffer anyway, if the *level* is 2d but some models are 3d
14:28
< celticminstrel>
I don't have 3D models.
14:28
< Rhamphoryncus>
But if it really is just a single non-overlapping tile for each section of the screen..
14:30 * celticminstrel waits...
14:31
< Rhamphoryncus>
.. then it's really simple, heh
14:31
< Rhamphoryncus>
What opengl version are you targeting?
14:32
< celticminstrel>
No specific one. I guess maybe OpenGL 3 -ish?
14:32 * Rhamphoryncus nods
14:33
< Rhamphoryncus>
Shaders or fixed-function?
14:33
< celticminstrel>
Well, I'm not writing any shaders.
14:33
< Rhamphoryncus>
Shaders are awesome :D
14:33
< celticminstrel>
Maybe, but I don't think they're necessary for an entirely 2D game...
14:34
< Rhamphoryncus>
It's not a question of necessity. They're simply a better way to do the job.
14:34
< celticminstrel>
There's no shading needed.
14:34
< Rhamphoryncus>
That's a misnomer
14:35
< Rhamphoryncus>
They may have started out just shading but they're really just functions on the GPU
14:35
<@TheWatcher>
Rhamphoryncus: well, a better way, provided the old fixed function pipeline doesn't do everything you need anyway
14:35
< Rhamphoryncus>
A vertex shader could, rather than taking 3 floats, take just 2 16-bit integers and output the floats
14:37
< Rhamphoryncus>
You can also stuff the tile indexes into a template and use that to index a texture array for the real tiles
14:37
< Rhamphoryncus>
TheWatcher: IMO fixed function is overly complex
14:39
< celticminstrel>
But that would require writing shaders, which is work. <_<
14:39
< Rhamphoryncus>
I suppose
14:40
< celticminstrel>
Anyway, when you said it's really simple, did you mean the clipping?
14:41
< Rhamphoryncus>
No, I meant that a regular 2d grid doesn't need most of the power of opengl, so there's many ways to approach it
14:41
< celticminstrel>
'kay
14:41
< Rhamphoryncus>
Most of the fun ones involving shaders, heh
14:42
< Rhamphoryncus>
Okay, another approach: how big are these tiles? If they're not too small it may be easier to draw them individually
14:42
< Rhamphoryncus>
Since they each use a different texture, presumably
14:42
< celticminstrel>
32x32, and I was already drawing them individually.
14:45
< Rhamphoryncus>
Honestly, I don't even know how to apply textures with fixed function
14:50
<@TheWatcher>
glBindTexture(GL_TEXTURE_2D, textureid); to bind the texture to the texture unit, then draw.
14:54
< Rhamphoryncus>
Hrm. If you're doing that then you could just cheat the vertices and wiggle them back and forth rather than having a full set. Assuming they're all evenly spaced out
14:57
< celticminstrel>
Huh?
14:57
< celticminstrel>
Are you now recommending not doing the whole level?
14:58
< Rhamphoryncus>
If you position the level at 0,0 exactly, then scroll by exactly 32 pixels, what's the difference in vertex positions?
15:00
< celticminstrel>
Nothing.
15:00
< celticminstrel>
Just the texture coordinates might need to change.
15:00
< Rhamphoryncus>
But you're specifying them individually anyway
15:00
< celticminstrel>
Hm?
15:01
< Rhamphoryncus>
If you do it as TheWatcher suggested then you need a separate draw call for each tile
15:02
< celticminstrel>
Not sure what you're getting at...
15:03
< Rhamphoryncus>
Each tile needs two things: the vertices and the texture. You're talking about sticking the vertices on the VBO, which would allow you to use a single draw call for all of them, but not for the textures, so you still need individual calls
15:04
<@TheWatcher>
Rhamphoryncus: not really. If you have one large texture with all the tile graphics on it, and a vertex array containing uvs are all locations in that one texture, you can just bind the texture once, then draw the vertex array
15:04
<@TheWatcher>
s/are all/that are all/
15:04
< celticminstrel>
All my tiles other than basic black and one other are on the same texture.
15:05
<@TheWatcher>
So, yeah. No need to rebind the texture unit, just draw away.
15:05
< celticminstrel>
And the "one other" I could manage by binding a completely transparent tile and drawing the background image in full prior to drawing the vertex array.
15:06
< celticminstrel>
(Currently I'm drawing a square tile from the background image when it's requested.)
15:06
< Rhamphoryncus>
TheWatcher: so not quite how you suggested with glBindTexture ;)
15:06
<@TheWatcher>
That's exactly as I suggested
15:06
<@TheWatcher>
Bind it and draw
15:06
< Rhamphoryncus>
That doesn't include any form of selection. How to make the uv coords work
15:07
<@TheWatcher>
You put them in the vertex array
15:09
<@TheWatcher>
Ig you create an interleaved array, you can specify the vertex coordinates, normals, and texture coordinates all in one array.
15:09
<@TheWatcher>
(plus a bunch of other things, but those are the important three)
15:11
< Rhamphoryncus>
What tells opengl that a certain part of the VBO (or old-school VAO?) is texture coordinates? I can do it with a shader but haven't seen the right function for fixed function
15:13
< Rhamphoryncus>
hrm. glTexCoordPointer
15:13
<@TheWatcher>
YEah.
15:13
< Rhamphoryncus>
Implicitly uses the globally bound GL_ARRAY_BUFFER
15:14
<@TheWatcher>
http://wwwopengl.org/wiki/Vertex_Arrays has a very brief example
15:14
<@TheWatcher>
+.
15:15
< Rhamphoryncus>
So this is all with old-school VAO's, which store on the CPU rather than the GPU
15:15
<@TheWatcher>
Yeah
15:16
<@TheWatcher>
(Or you can use InterleavedArrays() and a format that includes tecture coords like T2F_V3F or the like)
15:16
<@TheWatcher>
But, anyway, I must Perl...
15:17
< Rhamphoryncus>
So that's at least back to opengl2
15:19
<@TheWatcher>
Yeah, that sounds about right.
15:31
< Rhamphoryncus>
Looks like glInterleavedArrays is discouraged even for fixed function. Details are sketchy though
15:32
<@TheWatcher>
been ages since I used them, so I can't really remember
15:33
< celticminstrel>
I'm not really sure what method it's using. I'm using a wrapper here.
15:35
< Rhamphoryncus>
celticminstrel: my conclusion: don't worry about whole level vs partial level performance. Use whatever's easier to program until you get performance problems
15:35
< celticminstrel>
I'm going to do partial level since I'm not sure how to go about doing the clipping for whole level.
15:36
< celticminstrel>
Both would be faster than drawing each tile as its own primitive, right?
15:44 Noah [nbarr@Nightstar-f9a7901f.pools.spcsdns.net] has joined #code
16:13
< Rhamphoryncus>
I'm not sure. The whole approach is slower than what I'd do with shaders
16:27
< celticminstrel>
Maybe I'll try shaders after I get it to work without them, since refactoring to use a vertex array in the first place is a bit of work.
16:34 * Rhamphoryncus nods
16:38
< celticminstrel>
(When were shaders introduced?)
16:38
< RichyB>
celticminstrel, Toy Story 1.
16:38
< celticminstrel>
?
16:39
< Rhamphoryncus>
2.0
16:40
< RichyB>
AIUI, the history is that when Pixar made the first Toy Story film, they pioneered fragment shaders, which they wrote in C or C++ and ran in the middle of RenderMan runs, on their CPUs.
16:40
< Rhamphoryncus>
3.2 had geometry shaders. 4.0 had tessellation shaders.
16:41
< celticminstrel>
I wonder what my graphics card supports...
16:41
< celticminstrel>
I know it can handle Portal.
16:41
< RichyB>
and Pixar talked publicly about what they'd done and how, and a bunch of GPU manufacturers and games programmers read Pixar's papers and decided that it would be possible to implement a limited form of what Pixar had shown off in TS1 in real-time, with the right hardware.
16:42
< Rhamphoryncus>
celticminstrel: also, many things were available earlier as extensions or arb
16:42
< RichyB>
Rhamphoryncus, the wiki article makes it sound like "geometry shaders" and "tessellation shaders" are the same thing.
16:43
< Rhamphoryncus>
err? Quote?
16:43
< RichyB>
http://en.wikipedia.org/wiki/Shader#Geometry_shaders
16:44
< RichyB>
"Geometry shader programs are executed after vertex shaders. They take as input a whole primitive, possibly with adjacency information. For example, when operating on triangles, the three vertices are the geometry shader's input. The shader can then emit zero or more primitives, which are rasterized and their fragments ultimately passed to a pixel shader."
16:44
< RichyB>
"Typical uses of a geometry shader include point sprite generation, geometry tessellation, shadow volume extrusion, and single pass rendering to a cube map. A typical real world example of the benefits of geometry shaders would be automatic mesh complexity modification. A series of line strips representing control points for a curve are passed to the geometry shader and depending on the complexity required the shader can automatically ge
16:44
< RichyB>
nerate extra lines each of which provides a better approximation of a curve."
16:44
< Rhamphoryncus>
ugh
16:44
< Rhamphoryncus>
A common misunderstanding :(
16:44
< RichyB>
Rhamphoryncus, correct me?
16:44
< Rhamphoryncus>
You CAN tessellate with a geometry shader, but only on a small scale. It serializes
16:45
< RichyB>
It serializes?
16:45
< Rhamphoryncus>
Take a triangle and split into 1000 triangles? Only one core on your GPU will do all the work, the rest will wait
16:46
< RichyB>
Fun!
16:46
< Rhamphoryncus>
Take 1000 triangles and add a line sticking out from them? Each input will be on a separate core, so it's parallel
16:51
< Rhamphoryncus>
That page looks like it needs a hammer taken to it
16:51
< Rhamphoryncus>
geometry shaders are no longer high end
16:51 Derakon[AFK] is now known as Derakon
16:56 * Vornicus beats gamemaker with a cheese. There's a command to open the default browser, use it instead of iexplore
16:57
<@rms>
Ha
16:57
<@rms>
What command is that anyways?
16:58
< celticminstrel>
Oh hey. This all magically works... except that all the tiles drawn are the wrong ones.
16:59
< celticminstrel>
Hm. Seems that the tile to the left of the correct one is always drawn. Yay math errors.
17:01
<~Vornicus>
"start" instead of "iexplore"
17:02
< celticminstrel>
Oh. It's because I moved the enum constant assigned -1 elsewhere, so the one that was 0 is now -1. Duh.
17:03
< celticminstrel>
(I refer to tiles by enumerator names.)
17:03 EvilDarkLord is now known as Maze
17:08
< celticminstrel>
I'm still individually drawing tiles in the editor and the help, but I think that's probably okay.
17:09
< celticminstrel>
They're not contiguous in a tilemap, anyway.
17:11
< celticminstrel>
Zooming out in the editor... uh... doesn't really work too well...
17:12
< celticminstrel>
Oh, I think I see why.
17:12
< celticminstrel>
Hm, no, I'm accounting for the increase in area... it seems...
17:13
< celticminstrel>
(Basically it's drawing the first and second row in the first row, third and fourth row in the second row, etc)
17:14
< Rhamphoryncus>
oh yeah, my internet is made of awesome today
17:39 Derakon is now known as Derakon[AFK]
17:49 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has joined #code
17:49 mode/#code [+o Vash] by ChanServ
18:26 Attilla [Obsolete@Nightstar-fcd97f92.as43234.net] has quit [Ping timeout: 121 seconds]
18:37 Attilla [Obsolete@Nightstar-da0302d8.as43234.net] has joined #code
18:42 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Operation timed out]
18:45 * Vornicus tries to figure out how you actually create these.
18:54
< Rhamphoryncus>
Vornicus: switching between channels? ;)
18:54
<~Vornicus>
I thought I was in here in the first place~
18:54
< Rhamphoryncus>
Yeah, I get confused too
18:55
< Rhamphoryncus>
7 common nicks
18:56
< celticminstrel>
Which channel?
18:56
< Rhamphoryncus>
here and #DnD
18:56
<~Vornicus>
#dnd
18:56
< celticminstrel>
Ah
18:57
< Rhamphoryncus>
I started yammering about geodesic domes in there too :)
18:57 Kindamoody|out is now known as Kindamoody
18:59
< Rhamphoryncus>
I find the {1,0} special case to be interesting. You can think about the rotation of class III as a repeating decimal. In base 2 the {1,0} would be 1.0. Next would be 1.1. Then 1.11. 1.111, 1.1111, etc. Approaching but never reaching 2
19:16
< celticminstrel>
Oh hey. Apparently I'm trying to get 66.66666... frames per second.
19:17 Kindamoody is now known as Kindamoody[zZz]
19:18
< celticminstrel>
I didn't realize I was so close to a "standard" rate. <_<
19:20
< celticminstrel>
There's probably no point in redrawing the whole screen when I know nothing has changed...
19:25
< celticminstrel>
And now, having fixed that, I finally seem to be getting the desired frame rate.
19:26
< celticminstrel>
So I probably won't bother with the shaders unless something happens to slow things down again.
19:26
< celticminstrel>
...I really need to make this thing not accept input when it's not active.
19:35
< celticminstrel>
Much better.
19:42
< Rhamphoryncus>
fun trivia: It'd take somewhere around $50,000 to attend the meetings behind C++11
19:43
< Rhamphoryncus>
but it's an open standard that anybody can join :P
19:43
< celticminstrel>
Anyone, or anyone who has $50,000?
19:43
< celticminstrel>
:P
19:44
< Rhamphoryncus>
herb sutter claims anyone
19:44 McMartin [mcmartin@Nightstar-3f2d52e0.pltn13.sbcglobal.net] has quit [Operation timed out]
19:46
< celticminstrel>
So attending the meetings isn't required as a member?
19:47
< Rhamphoryncus>
Oh no, reading the results is only $30
19:47
< Rhamphoryncus>
There's probably some mailing lists you can post on to. (But I wouldn't be surprised if there aren't)
19:53
< Rhamphoryncus>
It could easily be a couple times larger than the $50000 I estimated. I took the cheapest plane ticks and hotel rooms, didn't include secondary travel when t he airports weren't in that city, nor did I include food or other expenses. However, I also only had 2 datapoints.
19:53
< Rhamphoryncus>
And I was looking at prices if I booked down, based on the month/day of two past meetings
19:54
< Rhamphoryncus>
Oh, lost wages too, heh
19:55
< Rhamphoryncus>
heh, I didn't align to weekends. Bet the flights were on saturday/sunday
20:09
<~Vornicus>
gnah
20:09
< Rhamphoryncus>
is the geodesic fighting back?
20:09
<~Vornicus>
No, I'm complaining at my high standards for programmer art
20:09
< Rhamphoryncus>
ah
20:37
< Rhamphoryncus>
Hrm, maybe a redundant addressing scheme. Pick a macroface and which of the 5 sides, then allow arbitrary distance out and at 60? to that. The legal range can be limited to maybe ?2 along the 60? axis and 2 past the end for distance out
20:39
< Rhamphoryncus>
Actually, if I'm doing that I should first establish the central point, then allow the ?2 as a separate step
20:47 * Rhamphoryncus prints out one of the antiprism images in B&W, finds the colour patterns disappear and one ones appear due to how dark/light the faces are x_x
21:07
<~Vornicus>
antiprism, heck I know the guy who makes that
21:10
< celticminstrel>
"one ones"?
21:13
<~Vornicus>
Oh, it's doing an energy calculation to determine points
21:13 * celticminstrel is making use of "automatic" breakpoints now.
21:13
< celticminstrel>
ie, breakpoints that do something instead of stopping execution.
21:13
<~Vornicus>
"new ones"
21:14
< celticminstrel>
Oh, yeah, that could make sense.
21:15 Attilla [Obsolete@Nightstar-da0302d8.as43234.net] has quit [Ping timeout: 121 seconds]
21:19 Attilla [Obsolete@Nightstar-da0302d8.as43234.net] has joined #code
21:39
< Rhamphoryncus>
yeah new ones
21:41
< Rhamphoryncus>
Alternative approach is to not have a way to directly index the faces. The primary uses will involve procedural generation at much higher detail levels or downsampling to much lower detail levels
21:46 maoranma [nbarr@Nightstar-04dbf5f6.pools.spcsdns.net] has joined #code
21:49 Noah [nbarr@Nightstar-f9a7901f.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
21:51 McMartin [mcmartin@Nightstar-c2a9aed7.pltn13.sbcglobal.net] has joined #code
21:51 mode/#code [+ao McMartin McMartin] by ChanServ
22:28 Maze is now known as EvilDarkLord
22:30
< celticminstrel>
Hm. If the screen will only ever change in response to user input (keypress or mouseclick), is there really any point in re-rendering it every quarter second or so?
22:31
<@rms>
You get to ignore checking to see if you should redraw because the OS forgot what you painted.
22:32
< celticminstrel>
True.
22:32
< celticminstrel>
I guess it doesn't hurt then.
22:36 * Rhamphoryncus pokes his geodesics
22:38 iospace is now known as io|gone
22:41
<~Vornicus>
The thing I found used an iterative "energy" solution to find the locations of the individual points
22:41
<~Vornicus>
This is not a great thing to have to do on the fly
22:43
< Rhamphoryncus>
... bollocks. The fact that my pentagons are slightly out of alignment means I can't do obvious ways of finding the location of the vertices
22:49
< Rhamphoryncus>
I wonder if that means there's 12*5 great circles involving the pentagons rather than 12*5/4 (each is shared by 4)
23:03
< Rhamphoryncus>
aha, 72?/2, 72?/5, 72?/8, 72?/11..
23:05
< Rhamphoryncus>
Not sure if that's 100% right, but it's close
23:05
< Rhamphoryncus>
pentagon rotation of http://www.antiprism.com/ex_album/580_geodesic_duals/geo_1_d_Lrg.jpg through http://www.antiprism.com/ex_album/580_geodesic_duals/geo_4_3_d_Lrg.jpg
23:06
< Rhamphoryncus>
But I may not have great circles at all
23:09
< Rhamphoryncus>
No, I'm pretty sure I don't. Going straight over a pentagon maintains a straight line. Narrowly missing one does not
23:09
< Rhamphoryncus>
I'd kill for a physical model right now XD
23:16
< Rhamphoryncus>
I'm not sure but there may only be a single path that covers the entire thing
23:17
< Rhamphoryncus>
No, it must hit another pentagon at some point
23:34
< Rhamphoryncus>
I don't suppose anybody here has blender compiled with collada support?
23:41
< Rhamphoryncus>
finds an official PPA, even documented as having it turned on :D
23:48 Attilla [Obsolete@Nightstar-da0302d8.as43234.net] has quit [[NS] Quit: ]
23:52
< Rhamphoryncus>
*twitch*
23:53
< Rhamphoryncus>
Well it turns out it's not official, despite being well run. And the officially guy in #blender is a dick about it.
23:54
< gnolam>
Someone from an open source graphics program project being a dick? Say it ain't so!
23:54
<&jerith>
It ain't so.
23:55 * gnolam glares at a certain image manipulation tool.
23:55 * jerith can't actually keep a straight face while typing that.
23:55
< Rhamphoryncus>
no kidding
23:58
< Rhamphoryncus>
Seems to think using a prebuilt tarball with install script is better than an official PPA (despite the PPA having a clear build of just 2 days ago)
23:58
<&McMartin>
PPA
23:58
<&McMartin>
?
23:58
< Rhamphoryncus>
ubuntu thing for private repositors
23:58
< Rhamphoryncus>
repositories
23:58
<&McMartin>
Aha
--- Log closed Wed Jun 27 00:00:07 2012
code logs -> 2012 -> Tue, 26 Jun 2012< code.20120625.log - code.20120627.log >

[ Latest log file ]