code logs -> 2014 -> Fri, 18 Apr 2014< code.20140417.log - code.20140419.log >
--- Log opened Fri Apr 18 00:00:45 2014
00:16 thalass [thalass@Nightstar-144jvc.bigpond.net.au] has joined #code
00:16 mode/#code [+o thalass] by ChanServ
00:26 Vornicus [Vorn@Nightstar-28h42k.sd.cox.net] has quit [Connection closed]
00:41 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
00:41 mode/#code [+o Orthia] by ChanServ
00:44 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
00:44 mode/#code [+qo Vornicus Vornicus] by ChanServ
01:03 Derakon[AFK2] is now known as Derakon
02:21 HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed]
02:23 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
02:59 macdjord|wurk is now known as macdjord
03:05 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has joined #code
03:06 mode/#code [+o celticminstrel] by ChanServ
03:54 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
03:59 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
03:59 mode/#code [+o Orthia] by ChanServ
04:06 HotShot [theeaznon@Nightstar-lmevr2.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 3days 11hrs 2mins 38secs]]
04:06 HotShot [fake@Nightstar-lmevr2.sfldmi.sbcglobal.net] has joined #code
04:08 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
04:08 mode/#code [+o himi] by ChanServ
04:39
<@celticminstrel>
My stencil buffer masking thing doesn't work and I have no clue why.
04:40 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:53 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
04:58 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
05:04 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
05:04 mode/#code [+o Orthia] by ChanServ
05:06 Derakon is now known as Derakon[AFK2]
05:07 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
05:07 mode/#code [+o himi] by ChanServ
05:30
<@celticminstrel>
Hm, it looks like the issue is that the offscreen thing I was drawing to doesn't have a stencil buffer.
05:30
<@celticminstrel>
The window certainly does though.
05:35 Kindamoody[zZz] is now known as Kindamoody
05:38
<@celticminstrel>
Gasp! It works! Well, sort of, at least.
05:39
<@celticminstrel>
There's the issue that the parts that are supposed to be transparent are instead white.
05:39
<@celticminstrel>
I expect I'm using the wrong stencil op/func.
05:42
<@celticminstrel>
Oh.
05:43
<@celticminstrel>
Wait, no, that doesn't work.
05:52 Syka [the@Nightstar-3j1.p6c.166.101.IP] has joined #code
05:54 Syka is now known as NSGuest2789
05:58 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
06:01
<@celticminstrel>
So yeah, the stencil buffer is set exactly how I want it, but when I fill the framing rect with solid colour, the bits that are supposed to be masked out are instead filled in with white.
06:02
<@celticminstrel>
Incidentally, I'm glad I discovered the OpenGL Profiler application.
06:02
<@Namegduf>
Do you have alpha blending enabled?
06:02
<@celticminstrel>
Uh. Good question.
06:03
<@Namegduf>
The thing you're drawing to needs an alpha channel, it needs to be filled with transparent by default, and it needs to be drawn with alpha blending to the screen.
06:03
<@celticminstrel>
The thing I'm drawing is literally a solid black rectangle.
06:03
<@celticminstrel>
The screen does have an alpha channel.
06:04 NSGuest2789 is now known as Syk
06:04
<@celticminstrel>
And it appears that I'm using alpha blending when drawing.
06:04
<@celticminstrel>
Um. Filled with transparent by default?
06:04
<@celticminstrel>
Like, glClearColor type of thing?
06:04 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
06:08 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code
06:08
<@celticminstrel>
...wait.
06:09
<@celticminstrel>
Maybe it's how I'm setting up the stencil buffer.
06:11
<@celticminstrel>
Yup.
06:11 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
06:11 mode/#code [+o himi] by ChanServ
06:11
<@celticminstrel>
While setting up the stencil buffer, I was drawing black shapes to the portion of the window I wanted to include, then white shapes on top of that where I wanted to exclude parts.
06:12
<@celticminstrel>
I changed it to draw all those shapes transparent, and now it works.
06:15
<@celticminstrel>
Now I need to figure out how to get a mask from a black-and-white image into the stencil buffer.
06:16
<@celticminstrel>
Such that black pixels set the stencil to 1 and white pixels set it to 0, and nothing changes onscreen.
06:16
<@celticminstrel>
Random side note, does 61 textures seem like a lot?
06:29
<@celticminstrel>
Aaand I just discovered glColorMask, which looks like it would've also solved my problem.
06:30
<@celticminstrel>
glBlitFramebuffer looks like it might do what I want, maybe.
06:31
<@celticminstrel>
Except I have no idea whether a texture counts as a framebuffer and suspect it might not.
06:32
<@Namegduf>
The texture needs an alpha channel.
06:32
<@Namegduf>
It probably has one, though, assuming you aren't doing anything odd.
06:33
<@celticminstrel>
It does, yeah.
06:33
<@celticminstrel>
Some of my textures don't, but the one with the masks does.
06:33
<@celticminstrel>
Well, the source images don't, at least; the textures might, I suppose.
06:34
<@Namegduf>
At least one solution, by the way, is to draw with a shader, such that you draw opaque for 1 and transparent for 0.
06:35
<@Namegduf>
Just let your read from the source texture go into the alpha channel.
06:35
<@celticminstrel>
Would that be an easy shader to write?
06:35
<@Namegduf>
Yeah.
06:35
<@celticminstrel>
Hm.
06:36
<@Namegduf>
The stencil buffer does its operation when you draw non-transparently on a pixel.
06:36
<@Namegduf>
As in, anything other than completely transparent.
06:36
<@celticminstrel>
Uh, actually, it does it when you draw a transparent pixel too, apparently.
06:36
<@Namegduf>
Hmm, I wonder what the options difference is.
06:36
<@celticminstrel>
Because I fixed my issue earlier by drawing the shapes transparent, and the stencil still worked.
06:37
<@Namegduf>
Are you doing non-premultiplied alpha?
06:37
<@Namegduf>
So you have transparent that isn't transparent black?
06:37
<@celticminstrel>
I think the transparent is transparent white, but I'm not 100% certain of this.
06:37
<@Namegduf>
Okay. It is entirely plausible to me that only transparent black is ignored.
06:38
<@Namegduf>
Since that's all zeros.
06:38
<@celticminstrel>
I see.
06:38
<@Namegduf>
I work with premultiplied alpha, so there is no other kind of transparent.
06:38
<@celticminstrel>
I'll check some stuff.
06:38
<@Namegduf>
So I think you might want to basically have a shader that draws transparent and inverts the colour.
06:39
<@Namegduf>
Guessing that that is it.
06:39
<@celticminstrel>
If it ignores all black, I can change the source image so that the transparent is black.
06:46
<@celticminstrel>
Oh wait, I don't have a stencil buffer in this context.
06:47
<@celticminstrel>
Maybe the shader is the better route after all...
06:47
<@celticminstrel>
Hm.
06:48
<@celticminstrel>
With a shader, is there some way I could draw first the mask, then the image to be masked, and combine them somehow?
06:53 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
06:54
<@celticminstrel>
Oh wow, I found someone trying to do almost exactly the same thing as me, even with the same library.
06:54
<@celticminstrel>
...maybe not quite exactly the same, but at least similar in the important aspect.
06:56
<@celticminstrel>
...wait, in what version were shaders added?
07:16 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
07:18 ErikMesoy [Erik@Nightstar-6v0.mal.203.80.IP] has quit [[NS] Quit: Leaving.]
07:18
<@celticminstrel>
Okay, EXC_BAD_ACCESS in the stream libraries now. Sigh.
07:18 ErikMesoy [Erik@Nightstar-6v0.mal.203.80.IP] has joined #code
07:19 mode/#code [+o ErikMesoy] by ChanServ
07:28
<@celticminstrel>
And it works if I load it in my own code instead of letting the library load it. Yay.
07:29 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
07:29 mode/#code [+o himi] by ChanServ
07:29
<@celticminstrel>
Finding the size of a file via fin.seekg(0, std::ios::end)!
07:29 Orthia is now known as Reivles
07:32
<@celticminstrel>
Why am I still naming variables with a _gworld prefix when I'm not even using Carbon?
07:32
<@celticminstrel>
(Or _gw)
08:01 Turaiel is now known as Turaiel[Offline]
08:14 Reivles [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [[NS] Quit: Going dooooown...]
08:14 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
08:14 mode/#code [+o Orthia] by ChanServ
08:15
<&McMartin>
Part 2 complete: https://hkn.eecs.berkeley.edu/~mcmartin/retro/colorchart2.html
08:15
<&McMartin>
And now bed
08:17
<@celticminstrel>
The shader works in the Shader Builder utility but not in my program.
08:18 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
08:23 macdjord is now known as macdjord|slep
08:31 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
08:31 mode/#code [+o himi] by ChanServ
08:46 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving]
08:58
<@celticminstrel>
I assume I'm just using it wrong or something, but I'll figure this out tomorrow.
08:59 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
09:02 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
09:14 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
09:14 mode/#code [+o himi] by ChanServ
09:36 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
09:36 mode/#code [+o JackKnife] by ChanServ
09:43
< Xon>
http://opensslrampage.org/ <- rofl
09:59 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
10:13 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
10:13 mode/#code [+o himi] by ChanServ
11:20 Kindamoody is now known as Kindamoody|afk
11:23 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
11:38 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
11:38 mode/#code [+o himi] by ChanServ
11:41 thalass [thalass@Nightstar-144jvc.bigpond.net.au] has quit [Ping timeout: 121 seconds]
11:58 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
12:12 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
12:12 mode/#code [+o himi] by ChanServ
12:37
<@AnnoDomini>
What's VMS and why is it terrible?
12:38
< Xon>
AnnoDomini, http://opensslrampage.org/post/82974555807/spray-the-apps-directory-with-anti-vm s-napalm-so <- apparently it leads to brain damage like this
12:47 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
12:57
<@Tamber>
VAX/VMS, presumably
13:47 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
13:50
<@Tarinaky>
It's a good thing online commerce isn't a serious application of the internet worth billions.
13:50
<@Tarinaky>
Otherwise we'd be in real trouble!
13:52
<@Tamber>
I know, right?
13:56 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
14:09 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
14:09 mode/#code [+o himi] by ChanServ
14:40 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
14:45 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [[NS] Quit: "Too long have night and day warred, their false dichotomy plaguing this land. No more. I come now to put them both down, to usher in a new era of balance and peace. For now is the time of... /Twilight/. *And the Dusk shall Reign Eternal.*"]
15:10
<&McMartin>
I know of at least one company that retains VAX/VMS or Alpha/VMS as a target OS, apparently for the uptime.
15:10
<&McMartin>
But it commits the deadly sin of Not Being UNIX, I suppose, and as we all know, being exactly like Unix is how you define "sanity"
15:12 ErikMesoy [Erik@Nightstar-6v0.mal.203.80.IP] has quit [[NS] Quit: Leaving.]
15:15 ErikMesoy [Erik@Nightstar-t5i7tl.80-203-18.nextgentel.com] has joined #code
15:16 mode/#code [+o ErikMesoy] by ChanServ
15:16 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has joined #code
15:16 mode/#code [+o celticminstrel] by ChanServ
15:50 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
16:03 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
16:04 mode/#code [+o himi] by ChanServ
16:20
<&jeroud>
Didn't it predate unix?
16:20
<&jeroud>
Or am I thinking of something else?
16:20
<&McMartin>
In practice I think it was a rough contemporary, though it may have slightly.
16:21
<&McMartin>
The VAX was definitely still around when UNIX was.
16:21
<&McMartin>
I open the OpenSSL Rampage is doing more than deleting code involving platforms that aren't OpenBSD, though. We have preprocessors for that. =P
16:21
<&McMartin>
s/open/hope/
16:22
<@celticminstrel>
Okay, the shader is definitely running, but it's not correctly applying the mask somehow.
16:23
<@celticminstrel>
When I changed it to draw the mask instead of the image, I get all plack, suggesting it may be using the same pixel from the mask for every pixel from the image.
16:25
<@celticminstrel>
...plack.
16:25
<@celticminstrel>
Black, duh.
16:29
<@celticminstrel>
Does this look okay? (Except line 13 should be texpix, not maskpix.) http://pastebin.com/reBMRTtK
16:30
<@celticminstrel>
Anything obviously wrong there?
16:30
<@celticminstrel>
The goal is to use a portion of the mask texture sort of as an alpha channel, where the mask texture is known to be just black and white.
16:31
<@celticminstrel>
The textures aren't the same size, maybe that could be an issue... and I'm actually only using a portion of the main texture as well.
16:32
<@celticminstrel>
The portions to be used should be the same size.
16:37 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
16:42 Kindamoody|afk is now known as Kindamoody
16:50 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
16:51 mode/#code [+o himi] by ChanServ
17:00
< Xon>
McMartin, a lot has been throwing sane & consistant code formating and removing layers and layers of insane macro wrapppers
17:01
< Xon>
or at least that is how it looks like
17:01
<@celticminstrel>
I have no idea why this isn't working. It does work in the Shader Builder tool, though, more or less.
17:03
<@celticminstrel>
I say "more or less" because Shader Builder only operates on full textures as far as I can tell, and I want to just operate on a portion of the texture.
17:03
<&McMartin>
Xon: ... gmm
17:03
<&McMartin>
hmm
17:04
<&McMartin>
I remember wanting something back in 2002 that would expand only a subset of the #defines, and I remember not finding anything that would do this systematically.
17:06
<@celticminstrel>
Anyone have any ideas?
17:06
< Xon>
McMartin, http://opensslrampage.org/post/83104947975 <- this is a rather sad bug.
17:07
<&McMartin>
OK, that's a proper bugfix, good.
17:07
< Xon>
land-mine API =|
17:08
< Xon>
http://opensslrampage.org/post/83006997401/portability-is-guarding-against-dev-n ull-wandering <- not sure why OpenSSL thought /dev/null can wander
17:08
<&McMartin>
Defensive coding~
17:09
<&McMartin>
I don't know enough about Every OS In The Entire Fucking World to know if there are null devices on OSes they support that act like /dev/null but aren't called that =P
17:09
<@celticminstrel>
Oh, I found another person doing something similar.
17:09
<&McMartin>
But if I'm OpenBSD, I don't care; it is not OpenBSD, burn it down, get a real OS
17:12
<@celticminstrel>
Didn't really help much.
17:13
<&McMartin>
Yeah
17:13
<&McMartin>
And given the general mess of the code, I'm pretty sure I'm being unduly suspicious
17:13 * celticminstrel sighs.
17:14
< Xon>
McMartin, the NUL_DEV compiler symbol /isn't actually used/
17:14
<&McMartin>
Then that's "dead code elimination", now isn't it~
17:17
< Xon>
McMartin, I'm not sure why OpenSSL had support for emulated x86 big-endian =p
17:18
< Xon>
http://opensslrampage.org/post/83031733755/remove-support-for-big-endian-i386-an d
17:18
< Xon>
amusng
17:19
<&McMartin>
I think UQM technically supports that, if you set the relevant #defines manually =P
17:21
<&McMartin>
The comment also implies that the "support" was a single line of code
17:23
< Xon>
http://freshbsd.org/commit/openbsd/c862290df5533966091ded3906da184f1cac8675
17:23
< Xon>
nope :(
17:23
<&McMartin>
Aha
17:23
<&McMartin>
Where was the commit link?
17:23
<&McMartin>
They say they have them but I only see them on the main page, not on individual posts
17:23
< Xon>
the blog is horrible for finding them
17:23
< Xon>
cos rofl cvs
17:24
< Xon>
http://freshbsd.org/search?project=openbsd&q=Remove+support+for+big-endian+i386+ and+amd64.
17:24
< Xon>
dumping the title into that finds the commit
17:27
<@celticminstrel>
It seems almost certain that the issue is caused by only the upper left pixel of the mask being used. Although... if that were the case, I don't think I'd be seeing the texture drawn at all in some places.
17:27
<@celticminstrel>
Whoa.
17:29
<@celticminstrel>
It looks like masking is occurring, just somehow not with the right mask.
17:29
<@celticminstrel>
Maybe I need to scale the offset into 0..1.
17:33
<@celticminstrel>
Still doesn't work.
17:49
<@celticminstrel>
Hm, I wonder if I need to also use a vertex shader...
18:00 AnnoDomini is now known as Number3
18:52
<@celticminstrel>
It doesn't even work if I copy the bits to draw into their own texture.
19:10 HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code
19:11 Kindamoody is now known as Kindamoody[zZz]
19:13 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
19:28 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has joined #code
19:28 mode/#code [+o celticminstrel] by ChanServ
19:31
<@celticminstrel>
I'm not quite sure why my computer seemingly crashed, but I assume it has something to do with building the application while it was already running.
19:52
<@celticminstrel>
Oh wow! Something works!
19:52
<@celticminstrel>
Okay, so.
19:53
<@celticminstrel>
The mask is being applied correctly, but the transformation is not being applied. Is that because I'm using a shader?
19:54
<@celticminstrel>
It's neither being flipped vertically nor being translated to the correct position onscreen.
20:26 HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed]
20:48
<@celticminstrel>
Still, I suppose it's progress, sort of.
20:50
<&McMartin>
Shaders replace their section of the pipeline; they do not extend it
20:51
<@celticminstrel>
But aren't vertex and fragment shaders different parts of the pipeline?
20:52
<&McMartin>
Yes, but I'm not sure whose job setting up texture samples is, for instance
20:52
<@celticminstrel>
Ooh, I just noticed I actually wasn't doing any translation.
20:53
<@celticminstrel>
Okay, now the only thing missing is flipping it vertically.
21:00
<@celticminstrel>
gl_TexCoord is read-only in a fragment shader.
21:03
<@celticminstrel>
...I should double-check that I'm not actually using the wrong mask,
21:07
<@celticminstrel>
Okay, yeah, I'm not.
21:12
<@celticminstrel>
It works! With the minor caveat that it isn't using the right texture sometimes, but that's a logic error in my program.
21:13
<@celticminstrel>
ie, that's me telling it to use the wrong texture.
21:13 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
21:13 mode/#code [+qo Vornicus Vornicus] by ChanServ
21:37
<@celticminstrel>
...
21:37
<@celticminstrel>
Why is there random data at the end of the shader.
21:40
<@celticminstrel>
Oh, I guess ifstream.read doesn't put a null at the end.
21:52 HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code
21:53 HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed]
21:57 Number3 is now known as AnnoDomini
22:38 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
23:20
<@gnolam>
http://freshbsd.org/commit/openbsd/eb5404392180ab68f190860b9d72a2cfea3b87df
23:20
<&McMartin>
celticminstrel: Yeah, it doesn't; it's like fread, not scanf("%s")
--- Log closed Sat Apr 19 00:00:01 2014
code logs -> 2014 -> Fri, 18 Apr 2014< code.20140417.log - code.20140419.log >

[ Latest log file ]