/dpt/ —Daily Programming Thread

Previous: What are you working on, Jow Forums?

Attached: vlcsnap-2018-04-08-02h38m57s995.png (1512x1072, 1.26M)

Other urls found in this thread:

pastebin.com/HShxqU3e
yodaiken.com/wp-content/uploads/2018/05/ub-1.pdf
en.wikipedia.org/wiki/Duff's_device
twitter.com/NSFWRedditGif

Nothing

programming is just a subset of anime

Fuck (You).

why is my compute shader causing a complete driver crash? I'm 90% sure it's the shader

pastebin.com/HShxqU3e
(please respond)

The two other times I've asked this, it has devolved into explaining why I dislike Haskell, and haskellfags being on the defensive about it.
No, I didn't have trouble with learning it either.
Did you not see the inb4

I wish a better language held the popular place that haskell does, because I appreciate a language's community and "ecosystem" (package management, libraries, docs and tutorials, people)

So asking in the new thread:
What's a good FP language, with some kind of type system that isn't dynamic?
Not interested in Haskell.

Attached: 1527191908493.png (305x300, 82K)

I'm cataloging & comparing hash, cipher, & other crypto functions.

Attached: Screen Shot 2018-05-30 at 4.48.51 PM.png (770x1494, 209K)

Very funny !
C-can I save this image ?

F# is decent , powerful, elegant and brainlet tier (very simple)

>praise $lang
k cool
>not want to learn it
hmm k how do you know it's so good then if you've yet to learn it?
>a better language
vague.

define elegant

>>not want to learn it
but user didn't say that

nvm i fixed it

not scala or ((()))

nvm it's still broken

I've been considering this but it feels too much of an uphill battle to do anything "dot net" (fucking what keyboard chewing imbecile named that) on linux, and I don't feel like getting a windows partition just for that.

>feels
What? Did you give it a try or are you acting like a little princess? It is 4 commands to install the package, one to create the project (or try out a template), one command to compile and one to run.
There is also F*

help please i beg

I didn't try, but I felt it's a fair assumption for anything windows working in linux.
However, maybe they're getting better, I'm willing to believe that. I did install VS Code quite easily, and though I don't often use IDEs, I would happily use it, it's quite good.
So now it's a matter of, suspending my disbelief about windows never playing nicely, and try getting dot net and F# operational on my linux machine. But still, it's not a high priority since I'd rather check out some other suggestions first:
Ada, idris and purescript seem the most interesting. I'd heard of idris before, but never bothered to look into it.

Boy, I just keep typing! Anyhow friend, thanks for your post, it really means a lot to me. Good luck in everything that you do.

help? someone, anyone, please?

this is a tileset I render with opengl. but do you see those white lines? they dont always show and shouldnt exist and are artifacts from texture filtering and mipmaps. they show when I zoom with the camera on certain zoom levels. how do I get rid of those lines?

I create the texture with mimaps and have filtering on MipMapNearestNearest, MipMapNearestNearest
linear isnt an option.

Attached: file.png (1922x1118, 1.07M)

Refactoring some old git repos from college.

Attached: download (1).jpg (225x225, 6K)

struct Vertex {
vec3 pos;
vec3 normal;
vec2 texCoord;
};

Is OpenGL padding those vec3's into vec4's? If so, there might be an out-of-bounds access somewhere. I don't know much about GL compute shaders but in Metal that would cause problems.

Try adding bleed margins between your tiles

check your texture border parameters in the sampler, and that there's no outline around them or whatever. Can't really give you a more detailed answer than that without the code though.

Optimizing codebase before database expansion on weekend. Optimizations are fun on smaller projects but when in order to optimize i have to rewrite 500 lines of code it gets tad bit tedious. But i managed to cut down loading time from few sec to instant and lowred ram usage 3 yimes so yay me!

>What are you working on, Jow Forums?
Today I made a standing desk with a sitting desk and cardboard box I had laying around.

You want to be using anti-aliasing, not mip-mapping. Anti-aliasing is guaranteed to leave no gaps, but mip-mapping is not.

Attached: aaaaa.png (864x439, 14K)

It's Vulkan, and it's std430 format. meaning the structs are going to be aligned on a 12-byte boundary in the shader storage buffer, but I don't think those vec3's are packed into vec4's correct?

I was thinking an OOB error as well

not sure I know what that means

you mean in the fragment shader? its literally just
gl_FragColor = texture2D(u_texture, v_texCoords);
opengl is really not my strong suite

anti-aliasing is a texture filter?

std430 layout rules say that a vec3 has the same size and alignment as a vec4.

The problem is at the edges, and you want geometry to define the edges, not alpha in the texture. Actually, you don't have to use anti-aliasing, but you could, to make the edges smooth. Regardless you need to have it set up like the right hand side of the diagram; you currently have it set up like the left hand side.

Does each tile have its own vertices, or are the vertices all in one buffer and referred to be index, or are they generated on-the-fly in a geometry shader or in the vertex shader itself?

by the sampler I meant the options that control mipmapping, etc. for the texture. You set these in the openGL API.

I think third user is right. Mipmapping averages out a group of pixels, introducing bleed.
Could you upload the whole tilemap?

An easy way to check whether it's a texture-mapping problem or a rasterization problem is by trying
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);

or something and seeing if there are still artifacts.

the first case. it's static geometry

well every tile is 2 polygons and with uvs for every vertex. not sure what I can do different

looks something like this. should I repack it with 1 pixel padding?

Attached: file.png (476x570, 55K)

>well every tile is 2 polygons and with uvs for every vertex. not sure what I can do different
I don't know how to explain it more simply than with the diagram I made. I don't think it's very difficult to understand.

where the hell are you finding the std430 layout rules
I've been googling and can't find anything

geometry is a quad and not a diamond. and so is the texture

Yes, that's what I said you were doing, and it needs to be not what you are doing. However, now that I look at that texture atlas, I see that there are bits sticking out past the tile boundaries, so the method I'm suggesting won't work.

The other user isn't suggesting you pack the texture any differently, but rather conservatively filter down so that the edges match up or at least overlap. I don't know what scaling algorithm you're using right now but it looks really bad and I'm not surprised you're getting seams.

"std430 layout rules"

yodaiken.com/wp-content/uploads/2018/05/ub-1.pdf
And here we see clearly that anything after C99 is garbage. How long until "C" turns into C++?

He's saying you shouldn't be doing mipmapping with your current tileset. If you were to align your tilesets correctly, you might be able to do mipmapping up to a certain level, but with a messy tileset like that it's going to be impossible. There's bleed on the diagonals due to mipmapping.
With each tile as a 64x64 and no border packed perfectly, you'll be able to do mipmapping up to the 7th level (no point going further).
Currently, you can't. Because your tileset is a mess, and mipmapping isn't magic. I suggest you look up what mipmapping is

which link?

Attached: hhhhhhh.png (1913x964, 96K)

The first one has it.

Attached: app09tab02[1].jpg (680x800, 268K)

when i clicked that one it asked me for my credit card

>Yes, that's what I said you were doing, and it needs to be not what you are doing.
wut?

>I see that there are bits sticking out past the tile boundaries,
yes and when building the vertex buffer it adjusts the geometry correctly.

> I don't know what scaling algorithm you're using right now but it looks really bad
the tiles are like 30x16 and probably almost as old as you are :^)

turned off mipmapping and it seems to work now

Is tracing gc overall a new win or net loss in perf?

Depends on the skill and patience of the programmer doing MMM you're comparing it with.

Serious question
Why does this general suck so much compared to other Jow Forums generals?

Strange, but there you go.

Serious answer
no cute k-on posters

dunno, what would you prefer to see here?
I think people get sick of me posting my project progress so I don't do it very often

Bleed margins are parts of the texture outside of the region selected by your UV coords

Attached: texture bleed.png (1000x500, 56K)

Best tutorial for WPF?

that's a good feeling!

I see this sentiment on all generals, maybe it's just the ones I go to. I think it's a perception thing, like it depends on your mood and also shittiness comes and goes so how the general "seems" can be a bit random.
Be the change you want to see, user! I believe in you!

What book to learn programming in C# ?

en.wikipedia.org/wiki/Duff's_device
Why is duff's device needed? Why can't he just jump back to an arbitrary offset, or write out the code in memory with the exact number of iterations?

ML in 2018
y/n

n

I want to make a foss vm for retro vidya.

Currently my plan is to have the event loop, frame throttle, audio playback and rendering all be part of the virtual hardware, completely outside the bytecode, and have all actual game cart bytecode implicitly constitute a coroutine, with a yield instruction available that just notifies the virtual hardware that the logic for this frame is over and the processor should stall until the next frame starts. Is this an acceptable approach to making games not awful to code? Would it actually be plausible to construct a physical retro game system that works this way?

>programming in C#
drink bleach, C# is the fugliest language i've ever seen and a shitty clone of Java

Doing some 3d tests with assembly

n
Just use Haskell

What do you recommend then ?

don't mip-map pixel art

Show me posts like this one in other generals:

People who program are completely different to people who talk about cellphones or desktop threads or whatever the fuck brainlets talk about

But user, everyone on Jow Forums programs. We're just the only ones vain enough to talk about it.

What do you people think about bloom shaders? (G)ood / (B)ad / get (F)ucked ?

Attached: scope.webm (1920x886, 1.35M)

>But user, everyone on Jow Forums programs
installing linux isn't programming

Thanks for proving my point

Java is prefferable to CShit, saner syntax (even if its sugar-coated). Java compiles faster too.
Sepples or Python, C# is hideous and teaches you shitty practice (even if its useful for Faggle programming)

I will be an asshole where i please, faggot

No, but OS dev is.
Or did you not realize everyone on /gee is an OS dev?

G

there really should be a seperate board for programming
I mean there's fucking boards for 3D modelling and origami

Anybody using bloom should be hanged. It's the worst shit ever.

It's literal eye cancer.

Nice thanks.
Any guide or book you recommend ?

>not just using C
>pic related: (You)

Attached: images (1).jpg (225x225, 8K)

Not sure what you're asking, it's for iterating over something as quickly as possible by linearizing operations with minimal intermediate jumps

you will think what you want, but most generals have a pretty consistent "good":shit ratio, and most generals have the occasional faggot crying that the general sucks. I'm not saying that to defend /dpt/ or anything, I rarely come here, but that's just how it is. Go spend some time in other generals, you'll see for yourself.

The O'Reilley series is a great start to begin with, after that just start reading the extensive online documentation, and look for info on how to make the code run faster. This applies to Java and Python, sepples is messy but useful desu

Its obvious user is looking for a high level mess-lang that can get shit done. C is a beautiful language but fuck me if it isn't a pain in the ass to deal with on larger projects.

This is basically how it was done IRL to my (limited) knowledge. The important thing to note though, is that for the rare game logic that's actually nicer to write in a loop than in a coroutine, most old systems had what was called the vertical blanking interrupt, a hook that was called once per frame, during the screen update (hence the name).

It uses jump tables, that's not "minimal". But why does he need to use switch in the first place? Can't he just use inline assembly to repeat the "assembly programmers' trick"?

It makes sense when you want to approximate brightness higher than what your display can put out. I don't know if it makes much sense for an oscilloscope, though.

Thanks senpai!

No one?

>It uses jump tables, that's not "minimal".
In general, jump tables minimize the actual number of jumps required because you don't have to filter down some kind of branching structure (like a series of if-else statements). In this case, instead of doing a check & jump after every element, it does it only every N elements. That minimizes the number of jumps that actually occur during runtime, which is the important part here.
And the reason assembly isn't used is because that's not portable, whereas the switch statement is the same thing but also portable — but most importantly pure C so you're not using multiple languages.

It could easily be made multiplatform with macros. Also, it would be faster. I know how it works for the first N elements, it's the last part I'm curious about. Wouldn't something like this be faster?
int iters = 81;
int is8 = iters/8;
int rem = iters%8
for (int i = is8; i; --i) {
doSomething;
doSomething;
doSomething;
label3;
doSomething;
label4;
}
jump(label4-rem*(label4-label3))

Obviously psuedocode, but you get the picture. That's what the assembler programmers used, couldn't an abominable function pointer hack be done if macros were too complex? It's not like code readability was a concern anyway.

Nope, no one.

Lmao angry java poster

You can't jump like that in C, which is why he used the switch. And in the end they're doing exactly the same thing, so they'd be just as fast.

I think java is shit but i cannot deny its utility, and fuck me i'll use it over CShit any day.

Does anyone know a finer way to write this?

This is my PS1 (I'm using bash)
PS1="┌─╼ \$(if [[ \$PWD/ = \$HOME/anime/* ]]; then \
echo \"\[\e[1;35m\](\[\e[0;35m\] •\[\e[1;35m\]^ ω ^) \[\e[1;34m\]\$(pwd | sed 's|'$HOME/anime/'|アニメ |; s|'$HOME/anime'|アニメ |')\[\e[0m\]\" \
; else \
echo \"\[\e[0;35m\]\u\[\e[1;36m\]::\[\e[0;32m\]\h \[\e[1;34m\]\w\[\e[0m\]\" \
; fi)\n──╼ "

Check pic related for how it works.

Attached: 2018-05-30-213247_691x448_scrot.png (691x448, 16K)

Why are you so upset though?

I'm not, i just really like being angry because it catches peoples attention and gets the message across. What's it to you Fa/g/got?

new to Jow Forums here
any good c++ guide for games

A "hyperreality network" / Media center for content sharing and discovery. Streaming vue.js and python/django programming at twitch / kingherring

Attached: aa6c04f8-7400-46e3-9772-903348917c32.png (480x600, 728K)

He could use inline assembly and a macro.
A switch is slower, unless the compiler optimizes it well. It needs to use an intermediate jump table, whereas the assembly method uses direct arithmetic.
e.g.
jump(label4 - rem(label4-label3)

vs
jump(table[rem])

The intermediate jump table is somewhat slower and harder to predict, no?

could use a function instead of pwd

It doesn't need the intermediate table in this case because the case values are contiguous.