03-22-2018, 07:06 AM
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
03-22-2018, 09:42 AM
Depending on what kind it is, some "scripting" is programming. E.g. Bash is Turing Complete and is described as a programming language. Stuff that's more that's more along the lines of macros that just iterate over a of existing functions (with little to no control flow) probably aren't Turing Complete, so I wouldn't consider that programming.
03-22-2018, 11:08 AM
Lambda calculus is at its heart an incredibly simplified macro expansion system, and that was approximately the first thing to be shown to be Turing-complete (as it was probably the first thing to be shown to be equivalent to a Turing machine). Turing completeness can come from very simple places.
03-22-2018, 12:41 PM
(03-22-2018, 11:08 AM)AnyOldName3 Wrote: [ -> ]Lambda calculus is at its heart an incredibly simplified macro expansion system, and that was approximately the first thing to be shown to be Turing-complete (as it was probably the first thing to be shown to be equivalent to a Turing machine). Turing completeness can come from very simple places.
Like I said, if it doesn't have control flow, those kinds of macros can't be Turing Complete (at least I don't see how they could be), but Lamda Calculus does that so it's fine. A good example of what I was trying to illustrate would the C/C++ preprocessor and its macros, which AFAIK are not really Turing Complete.
03-24-2018, 03:11 PM
It was shown a while back that Powerpoint is also Turing-Complete. I believe that one day we will all program using Powerpoint, and petty language wars will cease.
05-17-2018, 01:52 AM
Some Dolphin devs look at this thread and also happen to be the ones with GLSL experience, right?
Is there a built-in function/operator which converts homogeneous vec4 into a Cartesian vec3? I've got a really long vector name and need multiple things in the same line, so writing vecName.xyz / vecName.w makes things look ridiculous (with 270 character lines). I can work around the issue by splitting things into multiple lines, but doing things concisely should make the code much more readable.
Google seems to assume that any search with the word "homogeneous" included is someone who wants an explanation of what homogeneous coordinates are because they've never heard of them, so I get pages of irrelevant results based on that alone. (Has anyone else noticed that Google's spent the last couple of years getting increasingly shit at answering technical problems?)
Is there a built-in function/operator which converts homogeneous vec4 into a Cartesian vec3? I've got a really long vector name and need multiple things in the same line, so writing vecName.xyz / vecName.w makes things look ridiculous (with 270 character lines). I can work around the issue by splitting things into multiple lines, but doing things concisely should make the code much more readable.
Google seems to assume that any search with the word "homogeneous" included is someone who wants an explanation of what homogeneous coordinates are because they've never heard of them, so I get pages of irrelevant results based on that alone. (Has anyone else noticed that Google's spent the last couple of years getting increasingly shit at answering technical problems?)
05-17-2018, 03:49 AM
You could just define your own function in the shader that does what you want. I think something along the lines of this should work
more info here: https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#Functions
Code:
vec3 convert(vec4 src) {
return src.xyx/src.w;
}more info here: https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#Functions
05-17-2018, 04:43 AM
I know I could but if there's a built-in version, declaring a redundant copy of it just makes things more confusing.
05-17-2018, 07:50 AM
Yeah, that's a really good point. Which makes sense why you were asking people who know GLSL well. Unfortunately I don't really know it all that well, I just have a side project that I work on every now and then in OpenGL, so I don't know if there's a built-in. I scanned a couple sites claiming to list all the GLSL built-ins, but I didn't see any that do what you want, which is why I made the suggestion that I did.
Also, sorry that I presumed you were as much of a GLSL noob as I am. I've gotten into a bit of a habit of that recently due to group projects where members treat me like google when things aren't working right...
Also, sorry that I presumed you were as much of a GLSL noob as I am. I've gotten into a bit of a habit of that recently due to group projects where members treat me like google when things aren't working right...
05-17-2018, 09:05 AM
It's OpenMW's shadows, which (among other things, such as implemented in the first place) I'm switching from Parallel-Split Shadow Maps to Cascaded Shadow Maps. This means there needs to be logic to work out which shadow map to use (unlike PSSM which can just use all of them as a bad one never overlaps a good one), and that requires looking at the texture coordinates in cartesian form. (There's another potential implementation which doesn't require all of that and is slightly faster, but it goes for 'good enough' instead of 'best'.)
It's not even pure GLSL any more, either. OpenMW is forced to stick to GLSL 1.2, which doesn't support texture arrays, so to simulate it, there's a foreach macro so you can index things with a number in their name as if they were one thing which was an array.
It's not even pure GLSL any more, either. OpenMW is forced to stick to GLSL 1.2, which doesn't support texture arrays, so to simulate it, there's a foreach macro so you can index things with a number in their name as if they were one thing which was an array.