@JoshJers You can do 95% of this with a header file per API and a bunch of #defines. The last 5% is always tricky of course - you always seem to end up with some #ifdef HLSL sections - honestly that's probably the sweet spot anyway. To "fix" those, you start basically writing your own shader compiler for your own custom language, and that's a lot of work.
@mcc @Wevah IIRC, that formed the basis of the Itanium version of Windows, and then the ARM version. So basically ever since the 90s there has been some RISC version of Windows being built, and it kinda just changes #defines along the way - never quite becoming legit, always the red-headed step-child, but never actually being killed either.
@demofox The second major difference is that for the sake of not needing nine more #defines (one RGB per object type), I've opted to get rid of specularColor entirely, and to just let the old
throughput *= hitInfo.albedo;
be used. I don't think this should cause such a drastic chance in the pink ball either however?
So I'm done with page 2 and am now continuing to page 3, but my result looks quite off.
One major difference I can think of is that since we aren't allowed to edit our scene files, I've opted to use #defines to hardcode the emissive, specular, and roughness for every object type. I've used the values of the pink ball in your Shadertoy program, so am comparing the pink balls.
The pic on the left is of course mine, while yours is on the right.
#MagicalHorizons #Sometimes #Lose #Love #Deeper #Kinder #Stronger #Opportunity #Magical #Horizon #Friend #Outgrown #Yourself #Discover #Profound #Reason #Living #Undeniable #Purpose #Defines #TruePath #Quote #QuoteOfTheDay
#magicalhorizons #sometimes #lose #love #deeper #kinder #stronger #opportunity #magical #horizon #friend #outgrown #yourself #discover #profound #reason #living #undeniable #purpose #defines #truepath #quote #quoteoftheday
I like C, in general, but one thing that honks me off is the total lack of anything resembling a cross-platform bitfield. You have to use proprocessor #defines and masks and shifts if you want to extract bits.
@dotstdy @binarycrusader
I think there's also some stuff that gets inlined in some versions (I think I've seen that with some math functions?), and maybe "functions" that get renamed to different impls with #defines in newer versions, not sure about that part though
I tried some dirty hacks today. I wanted to do a basic port of #DOjS to #Linux by using a Linux version of Allegro 4.4 (for the graphics stuff) and ncurses (for the editor).
But I think the idea is doomed because I found NO WAY to get the same details for keyboard input as on #MSDOS.
The editor uses stuff like CTRL-UP/DOWN quite a lot.
I also had a very hard time because Allegro and ncurses did collide quite a lot on #defines and function names...
Currently developing an improved shader system for Flashback. It allows shaders to define their own uniforms w/type, range, defaults, and UI info. It also supports this with #defines via recompile-and-continue.
It's a little hacky but it *really* improves workflow & experimentation. Add a uniform in the editor and it automatically appears in the treeview at the specified place in the hierarchy.
Screen shot is of Flashback's shader editor/tester.
@marlinfirmware I have put the required #defines in my config, but I have not yet got around to properly tune it!
I guess /usr/include/X11/Xlib.h is the equivalent of Windows.h in all ways, including harmful #defines that randomly break stuff.
@XerShadowTail For static consts and #defines, sure. Anyone who uses that for variables or functions is a person who terrifies me. >.>
As we move on to 2023, here's a recap on stuff we released in 2022. These are absolutely FREE and open-source tools 😊
Hibernator is a library used to create idle applications that consume minimum resources in #Unity3d
DefineManager is a tool used to manage #defines in a Unity project to enable/disable optional features in supporting packages and to produce cleaner, more efficient code
DevMenu is a tool for Unity used to add custom commands to a developer menu for quick testing and debugging
He justified this position by pointing out that it's possible to use #defines in C to create a program coded entirely using underscores.
Yes, it's possible to code something poorly, and it's possible to put additional effort in to code something atrociously, but I think we're missing some key logical steps.
btw curses really should come with a header full of #defines or inline functions that give you more readable, modern function names. Because "wbkgdset" is not a good name for an API function
@nixfreak at the risk of completely shortcutting the intended puzzle, on this computer it prints OFF. which i was half expecting, just cause i wouldn't think one would post a question like this where the code does what one would expect based on a naive reading.
my guess was that this was some kind of subtle type casting shenanigans; when i changed the #defines to const chars it printed ON which seemed to confirm this.
i kind of suspect that if i went out and read the C standard (C99?) i could find a suspicious part; i also kind of suspect that the length of 'char' might be implementation def...
oh wait it's a *signed* char. isn't it. maybe that does it. cause if it's one byte long then 0xFF would turn the sign bit on, maybe, d...epending on...okay i won't claim to be able to analyze this in detail. i think either it turns the sign bit on, or it overflows, assuming char is a byte long, i kind of suspect the former but idk. (or maybe it just truncates the value so it fits in a signed char, leaving 254?)
also, what i don't know at *all* is what type gcc thinks of the literal 0xFF in status == ON as having... this gets weird to think about... but, like, i'm guessing that at runtime, it's checking something like -254 == 255
i guess i'm just an amateur C programmer after all. not surprising, really
---
i tried printf()ing the status inside print_message and got -1. which wasn't exactly what i imagined, but... kinda makes enough sense, i guess. i wonder if this is machine dependent
i suppose what it comes down to is that the literal 0xFF in status == ON is treated differently than the literal 0xFF passed as an argument to print_message