#Foundations - Learning Graphics Programming with the Zig Programming language

1 messages · Page 7 of 1

delicate delta
elder kettle
#

Nice

delicate delta
#

I had no idea what direction has been in all this time

elder kettle
#

Yeah very helpful

ivory verge
#

hehe, the skybox looks neat too

#

anicator will like it

delicate delta
#

It’s pretty cool! I mistakenly had srgb enabled though. uvsrgb

ivory verge
#

mistakenly? 🙂

delicate delta
#

I'm just a machine

#

time to keep going

#

those days that are gray were either really good days, like the day I went to Rome, or really bad days

#

like really bad days

#

that gray day in August was not a good day

elder kettle
#

Actually how is this possible

delicate delta
#

your project isn't on github?

#

I also write a lot of code for my job

elder kettle
#

Ah I don't use github for my job coding

#

that explains it

#

Is it possible it ignores branches or something?

queen hinge
#

I don't think it ignore branches

delicate delta
#

it doesn't consider unmerged PRs

#

until they're merged

#

so I think it does ignore branches

elder kettle
#

Maybe because I don't close the branches? Idk

#

I'm looking at several dozen commits from june right now

delicate delta
#

if you ever merge them it will backdate it

#

also

#

you can totally game that chart

#

people draw stuff on their charts

elder kettle
#

Lol

delicate delta
#

via fancy backdated git commits

#

that's all legit work in my case

elder kettle
#

I can't pull up the statistics for the repo since it's private but it's definitely not accurate I've made thousands of lines of changes this year

queen hinge
#

it does branches

delicate delta
#

do you have a green square for that commit

#

I remember not seeing green squares appear until I merge

#

that list is orthogonal I think to the squares

queen hinge
elder kettle
#

Yeah it also shows zero contributions in november when I wrote 5,000 lines of networking code so I must have just changed my workflow or something

delicate delta
#

it's not loc, it's commits I think

#

idk for sure

elder kettle
#

Yeah I know

#

I'm just saying I was writing a shitload of code then

queen hinge
#

ok yeah it does not do branches

queen hinge
queen hinge
delicate delta
#

so much better with a skycube

elder kettle
#

Idk where you got that from but you can generate those in space engine so you can go wherever you want in the universe and tune the exposure and stuff to get just the skybox you want

delicate delta
#

I got it from wikipedia

delicate delta
ivory verge
#

if you dont want realism there is also spacescape

maiden gazelle
#

I was scratching my head trying to remember spacescape

#

I searched for skyscape and was "huh, wasn't there something like this"

ivory verge
#

hehe been there done that

delicate delta
#

I can remove my unnecessary stb dependency by just storing gzips of rgba values and do a bare bones simple noise algorithm

#

stb doesn’t feel good in zig tbh and I don’t need it

#

I want to remove glfw too and just work directly with windows api eventually

#

I think eventually I can just a single dependency on the vulkan sdk being available

#

Although vulkan has a window thing iirc

delicate delta
#

I think gzipped bmp

#

I just want to always deal with one image format and, yesterdays texture headache will be totally avoided and stb can go in the bin and I will always know what bytes I have

queen hinge
#

gz each individual entry, throw it into a cpio, then apply xz twice

#

very efficient for file size

delicate delta
#

proton should work?

queen hinge
delicate delta
#

I will get a linux laptop and figure it out

queen hinge
delicate delta
#

I don’t want to deal with wayland/x windows so using windows apis and linking proton or however that works for linux is the thought I have, but maybe a vulkan specific thing exists

delicate delta
queen hinge
delicate delta
#

gzip should be fine

#

Why is that funny

queen hinge
delicate delta
#

There is a thing

queen hinge
#

Hm?

queen hinge
delicate delta
#

A nm

#

I will try the win32 thing

#

I just care about making progress on my goals and not about needling into specific tech tbh. I think it’s great for learning though you are building a wide base of knowledge

delicate delta
#

Nah I think i will use sdl

#

I can live with a sdl as a single dependency

#

Maybe vma

delicate delta
#

I return an error from my uniform now when it's not initialized, and added panics for everywhere I was creating uniforms if that error is encountered and I have found like 4 scenes that are crashing now

#

5

#

holyshit more things

#

my uniforms are a disaster

#

lol

queen hinge
#

I tend to go with -1 for uninitialized uniforms and just let the implementer decide if they want to panic or not KEKW

delicate delta
#

zig has proper errors

#

returning a -1 in zig is not a thing

queen hinge
#

java too has proper errors… other than that they’re slow

delicate delta
#

they're just fancy unions in zig they're cheap

#

basically just integers

queen hinge
#

Do you have stacktraces?

delicate delta
#

errors don't cause the program to exit

#

you're just forced to handle it

#

you can choose to crash

#

and then yes you have a stack trace

queen hinge
#

Java gets the stacktrace to then provide the error with the stacktrace to the handler bleakekw

#

Even if the handler doesn’t care about the error object at all bleaker_kekw

delicate delta
#

you should give zig a try, unless you like a stable language with good editor tooling and an ecosystem of any kind

queen hinge
#

I somewhat rely on an ecosystem and rely almost entirely on editor tooling bleakekw

delicate delta
#

I just make my own ecosystem

queen hinge
#

You would NOT be doing that in java (it is a pain)

#

JNI is not fun

delicate delta
#

literally zero plans to ever write anything in java

#

java is a great language and platform

#

I just don't plan on using is all, that wasn't intended as a slight

queen hinge
#

lol

#

java’s currently playing catchup to modern languages tbf

#

When it comes to the modern era, java is currently not great

delicate delta
#

I guess I fix all these issues then

#

I can't believe I have so many broken uniforms

#

hrmm

delicate delta
#

cool cool my shadowmaps were creating uniforms for textures for the depth pass

#

which weren't used or needed

#

that's gone, and those scenes work again

delicate delta
#

I need to test my scenes so I don't cause regressions like this

#

even with this uniform fix, I have to actually run the scene still to know it broke and I have so many scenes now

#

maybe a test scenes that just runs through all the scenes quickly

#

that's horrid

zinc trail
#

java issues: why is using a logging library so painful

#

also -1 for a uniform location is perfectly valid, just means its unused or optimized away, i wouldn't consider that an error. and if you say lookup block locations youll find they report -1 for certain things. but is still valid to upload to them, they more or less just no-op.

#

if anything id say its a warning at most

zinc trail
# queen hinge JNI is not fun

jni isnt as bad as i thought it was going to be when i tried it, granted no it isnt the nicest way to deal with stuff but it definitly can be worse

zinc trail
#

i will say there is something nice about cleaning up your shaders to not have unused stuff in it

delicate delta
#

it's not good for me I need those things to exist

#

i'm not making them to not exist

zinc trail
#

thats fair too, i just use introspection to dynamically get my uniform information so its sorta a non issue for my stuff

granite bolt
elder kettle
#

it does

#

it's the branches I think

delicate delta
#

I've just been fixing scenes since deccer pointed out my errors :(

#

found so much stuff that was broken I didn't know

#

nearly done

#

I'm never sharing my code ever again with anyone

#

that's the real lesson

delicate delta
#

thanks for looking at my code

#

I think I fixed all the shit

#

there was a lot of it

#

back to uh regular stuff I guess

ivory verge
#

if you insist on using strings and have them map to the locations, you could setup shader reflection, ask the program (after linking it) to give you the list of active uniforms, which you then stuff in a dictionary of sorts, and whenever you .Uniform("typoedUniformHere", 3.14f); it checks whether that string exists in the dictionary or not and yells at you if it doesnt

delicate delta
#

Oh I can just declare the locations

#

In the shader

#

I am smort

#

No I don’t want to use strings

delicate delta
#

I am going to build a template tool in zig I am so over my shader mess

#

My own stb include

#

Just like go templates

#

for my asset pipeline

#

Compile time not run time

#

Straight to spirv sit in a compressed asset folder, one for each scene/level

#

With models, textures, materials etc

#

One file load instead of many, maybe bundle shared things

#

Hot reloading of assets

ivory verge
#

you could technically define a .h file

#

with #define SAMPLER_BASECOLOR_TEXTURE 0 etc

#

and share it in code and glsl

#

and use SAMPLER_BASECOLOR_TEXTURE in

layout(binding = SAMPLER_BASECOLOR_TEXTURE) uniform sampler2D u_base_color;
...
glBindTextureUnit(SAMPLER_BASECOLOR_TEXTURE, yourbaseColorTextureId);
delicate delta
#

Yep

#

I like that

maiden gazelle
#

My aut… fauderisms saved the day for once

ivory verge
#

i just use hard coded numbers, since i know which slot goes to what, and the bindings usually never change

delicate delta
#

I want to use hard coded numbers

#

I wont change it atm though

queen hinge
#

mmm but that kills moddability

delicate delta
#

lol

#

what would anyone mod

#

there's nothing

#

0% percent anyone would want to mod anything I made

ivory verge
#

you would make it moddable by exposing a Renderer interface

#

and not just one tiny aspect of a specifically implemented - lets say - deferred renderer

#

and if you want to implement another deferred renderer for god knows reasons, just reimplement it the way you want

delicate delta
#

also all my projects and games are going to just be public on github with an MIT license so fully moddable if that was something people would ever want to do

wild ember
elder kettle
#

As a compiled application moddability is dead anyways

#

Unless you have an extensive scripting API

#

E.g. the game code is written in script

delicate delta
#

Talented people will not taken open source game and steal it for profit, they will make their own game and people who want to play games will get it through steam unless the demand is high but your price is higher than the burden of going outside steam for non-technical players

#

So I like open source

elder kettle
#

Yeah the modularity is what makes modding something that becomes a big ecosystem though

#

So just making the game open source doesn't get you to that point

delicate delta
#

That’s fair, I don’t have any goals for it personally atm

elder kettle
#

Yeah just saying it's a more delicate thing than it might seem

#

If you want to do it natively you'd want to expose a dll interface so that people can load the mod code in a modular way

#

There's also the issue that native code mods are a security risk so makes partaking in a modding ecosystem more risky for users

delicate delta
#

Having said that if you want big publisher support or investment don’t open source

#

I don’t think it would help

#

Like if you’re pitching your game

#

They might have a license policy

#

I only know how this works in b2b saas not video game industry

ivory verge
#

adding mod capabilities is certainly a rabbit hole

elder kettle
#

I have a scheme to do it

#

Well just for certain things

#

Basically just a way for weapons to be added in DLLs

ivory verge
#

: )

#

understandable

#

your weaponm4a1.c is like 400kloc 😄

wild ember
#

My personal approach is just not to think about mods at all

ivory verge
#

yeah not for the first game anyway 🙂

zinc trail
#

i start with mod support that make my own life easier lmao

delicate delta
delicate delta
#

that coordinate cross that shows the cardinal axes is so fucking helpful

#

idk why I waited so long to add it

delicate delta
queen hinge
#

so much GPU

delicate delta
#

it's kind of like they made a better OpenGL/WebGPU, and you don't have to use wgsl

queen hinge
#

looks sorta like vulkan and directx to me

delicate delta
#

nah it's much higher level

#

you don't need 3K lines to make a triangle

queen hinge
#

ok lemme correct myself: vulkan or directx if they were high level

delicate delta
#

right, I mean that sounds nice doesn't it?

queen hinge
#

(opengl to me is still opengl 3X and lower)

delicate delta
#

I don't really know how any of that works

queen hinge
#

a lot of my pipelines end up being the same thing but shader x instead of shader y and it's kinda annoying to deal with that

delicate delta
#

I'm just going to stick with vulkan

#

I mean once I start using it

late jackal
#

modern cross-platform API with limitations from the 2000s. no thanks

#

if you must ship a product on desktop and consoles, it might not be a bad choice

delicate delta
#

I would worry how to do more advanced techniques I'll read about using it, there would probably be a vulkan example

#

that I could find

#

probably not for this

delicate delta
#

The key to rendering photorealistic images is to properly account for light's behavior as it interacts with the objects in the scene.
Recording my notes of chapter 11 of GEA after having read it. A great chapter. Kind of an obvious point, but I like it anyway

#

100 page chapter heh

#

Basically a broad overview of a rendering engine

#

I now have 58 markdown files of notes in my note book repo

maiden gazelle
elder kettle
#

Tricks of the trade

#

Never lose sight of your coordinate axes

maiden gazelle
#

I guess I always had the same objects and walls right from the start, so I know my way around 😅 But if I toggled those off, it would be problematic yeah

delicate delta
#

every one of my scenes is a totally independent rendering without any kind of real mechanism to know up from down, it can be really disorienting once I moved away from the original camera position

#

so it was super helpful in my case, and especially helpful with cubemaps to understand if I did those correctly

#

and it helped me debug my env map

#

I could see that I yet again had another LH x up related issue

#

I was lost until I looked at the cross and realized oh something isn't being transformed into x up

#

(the normals of the cubemap in camera space)

#

in this particular case

#

it's probably less of an urgent issue if you're just going with basic RH Y up as the GL gods intended

#

I also do not impose any kind of orientation restriction on my camera, like the LOGL one limits you iirc from being able to end up looking upside down, I don't want that

#

my camera orientation is unique and so is my look at, I am really proud of my camera tbh

#

I can easily have multiple cameras with different characteristics

#

I use quaternions instead of three axis vectors

#

the camera produces that effect that makes my shuttle not appear stuck in the center of the screen as it orients around space

delicate delta
#

I gotta stop trying to read these 100 page GEA chapters in 1 day

#

I got 4 left, and one of them is like 40 pages and the rest are all over 100 pages I just have to like not rush

granite bolt
#

You will be so godlike after a year

delicate delta
#

It’s just a one time fixed cost to do this and then I don’t ever have to do it again

#

There’s no way I could have built all this context I have now by just “doing”, books work.

delicate delta
#

I actually think I like GLSL not at all

#

like fuck globals

#

first thing I did I didn't have a LH x-up issue

#

thank god for tangent space

queen hinge
#

or is your normal map inverted or something

delicate delta
#

also I knew to store the LH in the w for the tangent vector thanks to Lengyel even though the opengl book didnt' say to

#

why

#

how is it inverted

queen hinge
#

I... don't know if it is or not

#

ngl I'm not sure how I would figure that out KEKW

delicate delta
#

I am going to put the actual texture on it

#

it's correct the way I have it

#

that light is on the the side of the crater in which the light is coming from

#

I need a skybox on this

delicate delta
#

ok

#

the earth comes with a height map and a normal map

#

let me try that one

#

you know at some point I'm going to just be mostly spending time making animations, models and materials

#

and very little coding

#

I'm going to use Houdini + Marmoset for all of that

#

just get good at making animations at some point and using those tools

#

I'm not going to use blender

queen hinge
#

Why not blender?

queen hinge
delicate delta
#

because it's not as good

#

marmoset is amazing for making materials

#

and houdini is really amazing for making character animations

#

it's not that much for an individual

#

you can get Houdini from steam

#

marmoset is also really great for baking in textures

delicate delta
#

I do have a x LH issue 😞

#

it's more apparent with the earth

wise imp
#

houdini is just amazing

#

specially for programmers

delicate delta
#

I was looking at the videos for animating

wise imp
#

houdini for animation is meh

#

the main thing with houdini, is that its a toolkit of 3d art tools/anims/sims/etc

delicate delta
#

yes

wise imp
#

but not a program, a toolkit

delicate delta
#

hrm

wise imp
#

you can animate in houdini, but blender is better at that

#

where houdini becomes better than blender is when you have completely cracked and complicated rig systems

#

because in houdini all the bones/constraints/etc are in the node view and you can connect them with formulas, math, etc. You can use it to have very complicated semi-simulated animations and fancy rigs

#

this is not normally useful for typical game animation

delicate delta
#

I just want really good character animations

wise imp
#

this is probably the best

delicate delta
#

for like the npcs in my game

wise imp
#

i know a few other indie devs using this, its kind of a cheat code for mediocre animators

#

its main gimmick is that it does physical simulation alongside the animations

#

so its much easier to animate characters that move naturally with inertia and stuff

#

the AI-assisted is just investors/seobait, its not really AI, it works through physics simulations and fancy iks

delicate delta
#

I see

wise imp
#

the reason to use houdini is because you can use it for simply an absolute shitload of stuff

#

want some fancypants smoke particle fx? its literally the AAA standard there

#

want some terrains with procedural forests/roads/etc? also the AAA standard there

#

it comes built-in with a fuckload of scripts/tools/nodes for stuff like automatically optimizing meshes for games, baking AO textures, and processing photoscanned assets

delicate delta
#

nice

wise imp
#

on my VR game i used it to create a set of automatic optimizer "scripts"

#

using those nodes from the game-tools

#

so for example one i had which was a win was this:
I had a cave level, the cave level was made out of massive amounts of rock meshes just placed to build the cave walls. This was a lot of objects, and a lot of tris
the auto-optimizer with houdini was conected to unreal through the houdini engine plugin, and it grabbed all those rock meshes, booleaned them all together (to remove internal faces), and then, for each of their faces, raytraced against some point of interests in the map. The faces that are found to not be visible from those points got deleted.
After that, i ran a polygon reducer, biased by distance to those point of interest (to remove some polycount), and then the final optimized mesh, wich covered the whole level, got clusterized to split it into sections so that i can still frustum-cull them in-engine

delicate delta
#

wow, how much work was that?

#

seems like a lot

#

but sounds amazing

#

do you have a video?

wise imp
#

that was made in 1 hour

#

it was like 10 nodes

#

its considered "simple" for what people use houdini for

#

i also had a system that automatically optimized zbrush rocks. My artist made like 20 super-high-res rocks, i then loaded the 20 of them in houdini, polyreduced them, UV-d them all into the same texture for the 20 rocks, and did the AO/normal bakes, then saved it out of houding as 20 separate fbx files

#

that was pretty simple too

#

the downside of houdini is that the UI in general is atrociously bad

#

and its insanely complex a software

delicate delta
#

it does a lot

wise imp
#

there is just so much to it, its basically a massive SDK for tech-art stuff, and it has five programming languages on it

delicate delta
#

there's a lot of videos and tutorials for houdini

wise imp
#

houdiuni is so insanely massive you need to restrict yourself to a small area or its impossible

#

i mostly focused on the mesh/bakes/procgen stuff

delicate delta
#

I want to build small space station interiors and animate characters

wise imp
#

for character animation i already mention you dont really want it

delicate delta
#

right

wise imp
#

for space station interiors its def useful

#

you can create some semi-procedural assets that do autopaneling with decals and other fun things

#

there is some videos around it, lemme see if i can find it

#

there is a lot but this is a small example

delicate delta
#

yes just like that, thank you

#

I was looking at this for the animation https://www.sidefx.com/tutorials/animation-workshop/

#

it looks more capable than blender to me, but I don't have any experience with it and you do

wise imp
#

dont really recomend it vs blender and specially cascadeur

#

the ui is just kinda bad, its slow to use

#

when you are doing something like a movie, the houdini utilities become much more useful

#

but game anims are a very different thing

#

houdini still has cool things for rigs, weightpainting, and animation retargetting

#

but the anims themselves you are better making them in blender or cascadeur

#

one thing i used houdini for is on the weight painting of the vertices to the bones

#

blender systems there frankly are just utter garbage

#

its been unchanged for 20 years, literally, and it was never good to begin with

#

thats why you see the arms on my game characters be wonky and stuff. the weights are not set properly

delicate delta
#

I didn't notice

#

looking at cascadeur

#

looks good too

#

thank you for giving me all that context, I appreciate it 🙏

delicate delta
#

I had a brutal lesson in what -1 from a uniform location means today

#

and also I hate not being able to use bindless with renderdoc

#

I thought what -1 meant was that it couldn't find the uniform

#

and that's kind of what it means, but what it does is if you don't use uniform get rid of it, so me staring at my fucking shader, looking at the uniform

#

seeing it is there

#

and getting a -1

#

well

#

I learned to check if it was actually being used

#

after some misery

#

ready for vulkan

#

and validation layers

late jackal
#

vulkan man, take me by the hand

delicate delta
ivory verge
#

mf is really going for the actual "Foundation", building worlds 😛

ivory verge
delicate delta
#

thanks!

ivory verge
#

moon is tooooo close though heeh

#

and too big

delicate delta
#

hey that's super realistic I don't think you've been to space

ivory verge
#

😄

#

i prefer artistical freedom over realism

delicate delta
#

yeah I think the moon is so tiny and far away from the earth

#

I mean in real life

#

I have to share some of these in the zig game dev channel so they don't think I'm a scrub

#

I mean I am

#

anyway, back to more GEA I guess lol

ivory verge
#

moon is 280kkm away, and the earth diameter is ~12kkm

#

23 times the earth diameter is the moon away from earf

maiden gazelle
ivory verge
#

crazy how those numbers explode when you goto mars or further

delicate delta
#

yeah

#

I don't know why people want to go there

ivory verge
#

play in the sand

delicate delta
#

280K km

#

not a place you're gonna want to forget something important when you leave

ivory verge
#

hehe

#

yeah

#

to the moon and back is not THAT terrible

#

i believe its 2-3 days per trip

#

mars is 3 months or so if the planet is close to us

#

or 6 months?

delicate delta
#

I really like looking at trees

#

like seriously

#

looking at leaves blow in the wind

ivory verge
#

you could bring a bonsai 😛 and a fan

delicate delta
#

it's so calming

#

birds etc

#

fuck mars is what I'm saying

ivory verge
#

i know i know

delicate delta
#

it is a cool idea

#

but that's a one way trip, I'm sure of it

#

the first people going aren't coming back

late jackal
ivory verge
#

ye and we wont be having cost effective travelling back and forth on big shipz

#

mankind will destroy itself before that is going to happen

maiden gazelle
#

New fauna etc.

#

Could be interesting

delicate delta
ivory verge
#

yeah

delicate delta
#

I should build a gltf importer

#

tired of not having one

#

maybe take a break from reading just to get this

#

the next GEA chapter is animation anyway

#

hard to do any animating without some kind of animation thing

#

this is just going to delay vulkan though

#

maybe I power through the CGPOC book

#

CGPOC, vulkan, gltf, finish GEA and the rest of the books

#

I got to get out of this GL hole

ivory verge
#

none of the things you mentioned are going to run away 🙂

delicate delta
#

right, it's more about making progress on original goals and not leaving sight of them

ivory verge
#

ah

#

you are making excellent progress

delicate delta
#

but I guess with learning comes new information which can result in different decisions being revisited

ivory verge
#

and i also liked the funny looking blocken game thing before with the funny enderman-like people 😄

delicate delta
#

man I had no idea what I was doing, amazing how much progress I made

ivory verge
#

thats unbelievable

delicate delta
#

I could probably build a lot of that now in much less time and it would be way better

#

I think literally everything was in its own coordinate system

ivory verge
#

hehe

#

i feel quite the opposite these days

#

when i saw the planes thing on those screenshots i shared the other day

#

i was like wtf, i made this

#

i dont feel as capable as i was, its weird

delicate delta
#

it's still all there!

#

my thing is, I have done the jump around project thing, it doesn't lead to anything, I want to have something to show for my spare time

ivory verge
#

perhaps a reboot of blocken

delicate delta
#

that's the real goal, just to have something to point to that I did that I'm proud of and is worth showing off

#

nah I am going to build my little robot escape game idea

ivory verge
#

when you land your ships from space on any planet hehe, you get that blocky world or so

#

ah

delicate delta
#

no more open world voxel engines for me

#

you got like three of these types of voxel game community threads active on this server

ivory verge
#

i will support any idea you have

delicate delta
#

vulpengine, horde engine and project ascendant

#

don't need a blockens engine lol

#

their tech is so amazing

ivory verge
#

: )

#

perhaps you can make the enderman like person live in the new game though, he/she was really cool 😄

delicate delta
#

oh yeah for sure

#

the game idea I have is an obsolete old worker robot on a space station trying to escape reclamation

#

the maps wil sort of be like original Doom maps, though without having any combat capabilities, just puzzle solving and trying to get away from traps and things chasing you

ivory verge
#

ah thats a cool idea

delicate delta
#

I really want to limit the scale to be achievable

#

just build one level at a time

#

focus on gameplay without making any of it look good at first

ivory verge
#

the robot needs to reach the emergency capsule of sorts?

delicate delta
#

I think the idea is that throughout the game the robot becomes to care about more than just their own survival

#

and that escaping the end result is not really possible

#

spoilers sorry

#

the end cannot be avoided, but perhaps it can be made more meaningful

ivory verge
#

i see

delicate delta
#

like side quests to help others, multiple story lines, but all in a small game that's easy to make

ivory verge
#

im looking forward to play : )

delicate delta
#

me too

#

the problems I had in the last week and yesterday with uniforms and textures has really pushed me more to try out Vulkan. I have to load so many textures now, with cubes, height maps, normal maps, shadows and multiple objects and with bindless it's trivial, they just work, with non-bindless holy shit. I think if I was just not doing bindless this would probably be less painful than trying to maintain bindless and keep renderdoc working, and my issues with uniforms, which cost me like 3-5 hours yesterday, mostly to learn how uniforms in GL actually work, was brutal. I'm not making an argument against GL I just want to try validation layers and live the bindless life fully

#

it's also just a problem with how I wrote some of the code to be generic which I am just not going to do that anymore

#

no more generic code, everything will be hand crafted to the scene. I will want some shader building templating tools though to avoid code duplication, but I rather have duplication than some kind of generic shader generator that just causes more work in the long run everytime I want to do something new and different

#

we'll see maybe I end up hating vulkan

#

ok ok back to work

ivory verge
#

: )

#

a year ago or so

#

before that actually, because i got that rtx4070 a year ago pretty much

#

but before that i didnt have any bindless support, so i was forced to be a bit smort about my shit

#

and shedding a bike is always fun 🙂 i setup various texture2darrays for all my textures

#

and sorted all of them into buckets, one per resolution

#

and had an ivec2 pointing at and into the bucket

#

i think i used 8 texture2d arrays, to cover resolutions from 4096 down to whatever there was 32x32 or so

delicate delta
#

hrm so for one texture you had multiple resolutions? is that to save gpu memory?

#

I have just been loading the full resolution and mipmapping but these are just simple learning scenes and they don't exactly load fast when I load 8k textures

#

and big 3d models all blocking on the main thread

#

I got frames that last like a good few seconds atm :D

#

I'm just focused on learning the graphics techniques

ivory verge
#

nono

#

i had like n textures for all my models

delicate delta
#

ohh

ivory verge
#

some where 1024x1024 some were just 128x128

#

with their dimensions i knew into which bucket they go when i upload the pixel data

delicate delta
#

I was looking at some zig packing libraries a while back

ivory verge
#

with packing i dont mean packing textures into an atlas

#

but that would be yet another option

delicate delta
#

that one is not zig obviously

delicate delta
#

or reminded me of it

#

hrm

ivory verge
#

ah

#

packing is a tiny bit tricky

#

not the packing itself, thats somewhat solved

#

but whether you leave some space between the tiles or not

delicate delta
#

oh right

delicate delta
ivory verge
#

i keep forgetting where i post shit

#

i think i abused Jake's post

delicate delta
#

impossible to search threads on discord :(

#

or I am too smoll brain

ivory verge
#

or lofty lagoon 😄

late jackal
#

lofty lagoop

ivory verge
#

#1126099727621046332 message

#

apparently it was splitscreen 😄

#

2 people could fly around at the same time

#

using the keyboard hehe

delicate delta
#

the same keyboard?

#

that's really cool, this is with delphi?

#

are those mountains geometry?

#

how did you render those

#

I love this color scehme

ivory verge
ivory verge
#

ah but all the color gradients were custom

#

i was inspired by that other engine, i keep forgetting its name, not leadwerks but something similar, froyok will probably know 🙂

delicate delta
#

you used a windows NT kernel on your personal computer

#

?

#

windows 2k?

ivory verge
#

yes?

delicate delta
#

how do you install AOL on that

late jackal
#

Ahead of Linux

ivory verge
#

win95, win98, win98se, winme, win2k, winxp, winxp64, vista very very briefly, win7, win8, win81, win10

delicate delta
#

the full tour

ivory verge
#

ye, win11 only for work

delicate delta
#

I'm sorry for your win 8 experiences

#

also win me

ivory verge
#

ah no, my pc has a win11 partition too

late jackal
#

My first pc was vista

#

I used xp on my dad's pc when I was like 4

ivory verge
#

win8 was not any badder, tbh, the only weird thing was winrt apps and the menu, but i didnt mind really, i hardly spend time in the menu to be upset about not being able to see the bloody wallpaper

delicate delta
#

I feel really old suddenly

ivory verge
#

i fiddled with dos 3, 5, 6, 622 too

#

before windows

delicate delta
#

yeah I lived in a place as a teen where they had a dos 6

#

that was cool

ivory verge
#

: )

#

i started 1990 to mess with computers

delicate delta
#

I logged on to BBS

#

my dad had a work computer which was like a mac from Olympia where he worked, a german computer company

ivory verge
#

BBSes are so cool

delicate delta
#

this was like the 80's

ivory verge
#

uh thats cool

delicate delta
#

like this thing I guess

#

I actually cannot find it online properly

#

pre internet

ivory verge
#

i miss the old green and amber phosphor CRTs

#

ah speaking of pcs

#

i was also exposed to apple hardware

#

not the first ones, but shit that existed in the 90s... i remember apple powerbook 150 something

#

and two or three different powermacs for desktop

#

256 colors and flat crt somehow

#

macos 4, till 8

#

and some cool games... Loom, Hellcats and Shufflepuck

delicate delta
#

I like computers

#

they're all so generic now

#

they used to have real character

ivory verge
#

yeah, like the BRRRRRRRRRRRRRRRZZZZT degaussing sound when you switched them on 😄

delicate delta
#

the loudest thing I ever had was the zip disk

#

it had like a really loud physical clicking sound

ivory verge
#

i always wanted one 🙂

delicate delta
#

they were awful

ivory verge
#

yeah

#

i think i eventually got one right before nobody would use them anymore

#

and never used it for anything either

delicate delta
#

it's good, because you would have lost whatever you stored on them

ivory verge
#

unlike the CD and CD-R drives 😄 the early burner drives with special caddies

delicate delta
#

the failure rate was ridiculous

#

Click of death is a term that had become common in the late 1990s referring to the clicking sound in disk storage systems that signals a disk drive has failed, often catastrophically.
The clicking sound itself arises from the unexpected movement of the disk's read/write actuator. At startup, and during use, the disk head must move correctly and ...

ivory verge
#

i remember that

#

obsolete tech, like minidisc

delicate delta
#

man I wish the minidisc had taken off

ivory verge
#

same

#

that was cool shit, and nerdy stuff

delicate delta
#

I saw minidisk players in japan when I was stationed in okinawa and wanted to get one, seemed like they flopped as soon as they arrived

ivory verge
#

yeah

#

i wanted one back then too, and much much later, like 10 years ago or so i tried to see if i can get some second hand or so

#

but they are too expensive 😄

delicate delta
#

I am not surprised, floppy disks are expensive too now

ivory verge
#

there is 1 guy left on the planet

#

who keeps buying all stock when possible

#

and from him you can still buy packs of floppies

delicate delta
#

:|

ivory verge
#

airlines buy from him too 😄

delicate delta
#

that's a cool business

ivory verge
#

i think its a german dude, old fart

delicate delta
#

I'm glad my flight's safety is in the hands of floppy disk technologies

ivory verge
#

and the subway in NYC too

wild ember
ivory verge
#

: )

delicate delta
delicate delta
#

I'm making my own little stb_include I'm so over my awful shader situation I just want include and defines, it's going to start of being really basic, a new executable in my build.zig

#

even at a most basic level it will be 100x better than my current situation

zinc trail
#

Glsl supports defines already though. You don't need custom preprocessor for it

#

#include tho you'll want it. It's really nice

ivory verge
#

i suppose bjorn was saying that he will write his own because zig cant wrap headers only? or can it?

zinc trail
#

No clue but in glsl code you can happily define. ifdef if defined etc

#

That stuff works. There's also an extention for native #include but I wouldn't rely on that

ivory verge
#

yes thats out of ze question

zinc trail
#

I've tried it and it does work but mann

delicate delta
#

yeah I don't want those

#

I want to be able to see the compiled shader source as it will be linked

#

it's nice those are valid GLSL though because I don't want my template system to break the GLSL syntax highlighting

#

I'm basically going to overload define and include to mean what I want them to mean for me

#

I don't know what wrap header only means

zinc trail
#

The way I do it is I just have a section of defines dynamically generated for the stb include

delicate delta
#

yeah I am basically going to make my own stb include to avoid the Cisms of it

#

I mean it's already in progress

zinc trail
#

I probably will as well since stb include isn't actively worked on and doesn't support the features I want anyhow

delicate delta
#

I am going to get rid of stb_image also by just using gzipped bmps

#

and then stb_perlin I want to remove also with a simple noise function, I barely use it

#

I think my dependencies will just be vulkan sdk, vulkan memory allocator, and vulkan zig bindings and SDL

#

SDL has audio that's good enough if not something else, and idk how far I can get without something like jolt or bullet

#

I am going to write my own glft importer

zinc trail
#

Crazy

delicate delta
#

why?

#

it's a pretty straightforward spec

#

just json with some binary blobs at the end

zinc trail
#

Not actuslly crazy. I'm just losing my mind.

#

Like all of what you said there is reasonable

delicate delta
#

taking me a bit, my actual day job is basically a 24 hour a day job at this point constantly interrupting my life, weekends, nights and evenings, every day

I got this far today

$ zig build fssc -- --source .\src\foundations\scenes\cgpoc\chapter10\surface_detail\earth_frag.glsl --name earth_frag_improved --output .\src\foundations\scenes\cgpoc\chapter10\surface_detail\
Starting compiler.
args:
        --source .\src\foundations\scenes\cgpoc\chapter10\surface_detail\earth_frag.glsl
        --output .\src\foundations\scenes\cgpoc\chapter10\surface_detail\
        --name: earth_frag_improved
file path C:\Users\swart\projects\foundations\.\src\foundations\scenes\cgpoc\chapter10\surface_detail\earth_frag.glsl
numbytes: 836
Found 1 includes.
        src/foundations/shaders/f_calc_new_normal.glsl
Compiler finished.
#

so close

wild ember
#

What is your day job btw?

ivory verge
#

inb4 keeping frogs out of nuclear launch sites

delicate delta
#

I am a tech lead for an engineering team at a security/identity/access management startup

ivory verge
#

nice

#

you guys have to implement oauth 2.1 et al

#

among other things hehe

delicate delta
#

well we don't provide single sign on as a service, we just help you manage access to your employees and review that access

#

like automatic onboarding

#

and compliance stuff

ivory verge
#

ah so more like HCIM/HRIS

delicate delta
#

so many acronyms

#

yes

ivory verge
#

human capital/human resources stuff

delicate delta
#

it's more security and compliance, it's super cross team stuff

#

like IT, HR, security

ivory verge
#

i see

delicate delta
#

so we have customers who operate at IST time

ivory verge
#

good, its not workday or icims 🙂

delicate delta
#

and that's been keeping me up

#

well we have a workday connector

#

and also we have potential customers we're trying to make successful and convert to paying customers and that requires being super responsive at any hour

ivory verge
#

oof

wild ember
#

Rough

delicate delta
#

yeah

#

startup life

wild ember
#

There's pros and cons to working for a giant corporation

#

But at least my schedule is pretty stable

delicate delta
#

yes, I have been working at startups my entire career except when the startup was acquired so had a couple of times I ended up at a large corp before going to the next startup

#

I really don't like working at big corps

#

it's hard work at startup, but everything you do matters

#

there's no working a year on something that never sees the light of day

delicate delta
#

my compiler works

#

I can't use it yet, because I need it to generate both a bindless and non-bindless version for when textures are present and I am so over this

#

having to worry about both bindless and not

#

you know

#

I'll just have two source files for now I don't care

#

I am going to go vulkan soon

delicate delta
#

I am going to just add my shader compiler to my zig build as a build step command and it will build my shaders automatically

#

So I have both an executable i can run at will or just import the code the binary uses as part of the build

#

Just zig things. When your build system is the same language at your application source code

#

I haven’t built a non-zig target build step before so will have to look that up

delicate delta
#

Or maybe run it as a comptime tool?

#

I can just string replace the bindless layout with a texture unit number thst increments and not actually write the output

#

Embed both versions

delicate delta
#

I hate non-bindless

#

const needle: []const u8 = "layout(bindless_sampler)";
const needle_len: usize = needle.len;

pub fn replaceBindless(
    bytes: []const u8,
    locations: []const usize,
) !struct { bytes: []const u8, loc: usize } {
    var buf: [50]u8 = undefined;
    var linesIterator = std.mem.splitScalar(u8, bytes, '\n');
    var loc: usize = 0;

    while (linesIterator.next()) |line| {
        const replacement_buf = " " ** needle_len;
        if (line.len < needle_len) continue;
        if (!std.mem.eql(line[0..needle_len], needle)) continue;
        const replacement = try std.fmt.bufPrint(
            &buf,
            "layout(binding={d})",
            .{locations[loc]},
        );
        @memcpy(replacement_buf[0..replacement.len], replacement);
        @memcpy(line[0..needle_len], replacement_buf[0..needle_len]);
        loc += 1;
        if (loc == locations.len) return;
    }
}
#

for making me write code like that

#

I think this will work

#

it's close to something that will work

#

once this works I don't have to worry about non-bindless too much anymore though

delicate delta
#

this has to be the worst code I have ever written

#

anyway

#

back to rendering stuff

zinc trail
#

the code isnt bad if it works berubeShrug

delicate delta
#

you know what I was thinking was

#

what if I wanted to update one of my structs, that's in like every shader, my camera struct

#

I would have to update every shader

#

this situation is better now mostly

#

I am doing the compile still at runtime because I wanted to see how that worked it worked well, it is slower though, but I can actually update my shader code now without rebuilding

elder kettle
#

Ah I thought you were referring to the interface structs

#

like the data you pass into the program

delicate delta
#

the thing I built is both an executable and something I load in as run time

#

I meant the ubo ssbo structs

elder kettle
#

ah yeah those

#

Are you hot-reloading your host application though?

delicate delta
#

not yet

elder kettle
#

Don't the inputs have fixed layouts

delicate delta
#

yeah those I couldn't update without rebuilding

#

I want to get to hot reloading

#

zig doesn't have translation units like C++ or C

#

you have to like intentionally create a translation unit

#

I mean there are TUs, but it's not at all the same

delicate delta
#

so excited about how nice it will be now to write lots of good shader code, reusable and everything, no more worrying about bindless or application code getting in the way

#

I'm going to write some right now

elder kettle
#

I am tempted to try Vcc or some of those new fancy shader things but I think they're not ready yet

delicate delta
#

what's a Vcc let me look hrmm

elder kettle
#

gob's experimental C++-to-SPIR-V compiler

delicate delta
#

ohh I see

#

yeah zig has zig to spirv

#

I can't use it with gl as I understand it, it mostly just works in compute atm iirc

elder kettle
#

I started using stb_include as of a couple months ago for my more complex foliage pipeline stuff and yeah shader includes are very handy

delicate delta
#

it's also experimental

#

yeah if I were writing C or C++ I would use stb but I'm trying to get rid of it in my zig

#

it's too unzig like

elder kettle
#

ah

delicate delta
#

I got all these tools now, I make a new scene, I add a camera, I add my little axis cross, boom stuff shows up, it's nice

#

a lot of work already put into this

#

a little bit of boiler plate for each object I add, I'll have to make that better

#

I need more of a callback thing

#

define callbacks on my objects instead of dropping the functions in my scenes or something

merry surge
delicate delta
#

it's pretty readable, you're just not used to it!

#

I think C++ is readable though 🤔

merry surge
#

yeah I was just joking I can read it if I go through it carefully

delicate delta
#

I think ruby and lisp is unreadable

merry surge
#

after all this time I can just look at C++ and basically instantly see what's going on

delicate delta
#

give me curly braces or give me death

#

my zig is not good zig, also that code doesn't work, I just wrote it thinking it would work

#

the gist shows what actually worked

#

and it's nothing like what I initially wrote

#

I was not close :/

#

the gist is much worse

merry surge
#

I like being able to return anonymous structs

delicate delta
#

all these splits and shit in std.mem are immutable and I'm trying to write to these things so I don't have to allocate memory weirdly

merry surge
#

man what if we just had a C++ 2 that ditched a lot of the compatibility with C and older versions to just fix up some things and make it a better lang

delicate delta
#

isn't that D

#

nobody uses it

merry surge
#

no D has a completely different syntax

delicate delta
#

I'm sure someone uses it

wise imp
#

Circle with some of the features enabled that fix old cpp shit is kinda that

delicate delta
#

trying out a hardware tessellator thingy

#

oh I wonder what it looks like in renderdoc

ivory verge
#

you dont need all that layout(bindless_sampler) bs

#

i suppose you usually dont pass individual bindless handles via programuniform64nv

#

you stuff texturehandles into a boofer and make use of the int64_t extension, which you can just enable

#

and then texture(sampler2D(material.base_color_texture), v_uv)...

delicate delta
#

they're all in uniforms atm :/

#

ooh new fancy UI

ivory verge
#

looks like tesselation

#

ah

#

😄

delicate delta
#

yeah

#

cool the mesh viewer is useless

#

maybe I need a more complex tessallation thingy

#

texture(sampler2D(material.base_color_texture), v_uv)...
I like this

#

I already have a materials buffer

#

so that makes sense

#

that ain't going to work with uh renderdoc though I think?

#

ok checking nsight then going to bed

ivory verge
#

it will work in renderdoc

#

but

#

not for bindless handles, remember

#

the "good" thing is

#

64bit texture handles can be represented by a i or uvec2

#

and a i/uvec2 you can use to address texture atlasses as i described ages ago

delicate delta
#

ah

ivory verge
#

you have resolution based texture2Darrays, lets say 8 of them

#

where each represents a fixed resolution, from 32x32 up to 4096x4096, that should cover most if not all texture needs

delicate delta
#

right I remember you saying this

ivory verge
#

and then you use the uvec2 to texture(u_textures[uvec2.x], uvec2.y, v_uv)...

#

the only caveat is the spooky nonuniform access bs, where you would need to employ a bit of shader magic, if you searchbox-text for NonUniformIndex

#

hmm actually im not sure on the stuff i just removed

delicate delta
#

I haven't used texture arrays yet

#

just cube maps

ivory verge
#

its pretty much the same

#

you get another parameter you have to pass into the sampling function, for texture2Darrays its just the layer

delicate delta
#

yeah they seem like a nice way to just send a whole bunch of textures in one buffer and then you only need one sampler? that's cool

#

I think I get it

#

so you don't run out of texture units and have to manage them

ivory verge
#

potentially there could be a problem, now that i think about it

#

SAMPLER being the key here 😄

delicate delta
#

oh is it doing like bilinear sampling across the textures

ivory verge
#

perhaps your scene requires more than one specific sampler (min/mag/warpR/warpS)

#

then you need a bit of permutation galore, or you split your draws across those

#

but even finking further, perhaps the idea of encoding textures like i just described makes no sense at all for that sort of thing, and you are perhaps fucked when you need more than 1 sampler

#

samplers can be "embedded" into texture objects directly, thats what the whole glGenTextures+glTexParameterx... does... or you can have them separated... texture objects (glcreatetextures+glTextureStorage) and sampler objects glCreateSamplers+glSamplerParameter... and setup min/mag/warpr/warps there

delicate delta
#

so much I don't know :\

#

I am going to bed gn some more tessallation tomorrow I think

ivory verge
#

oki 🙂 🇬🇳

#

i keep thinking out loud for another minute

#

you still do glBindTextureUnit... as usual with texture2darrays

#

and if you split your draws across different samplers because you need one cube nearest filtered for some reason, you can just draw that cube then with glBindSampler(...the_sampler_with_nearest_filtereing) and keep the rest as is

#

materialindex is encoded into your instancedata ubo/ssbo perhaps

#
// vs
layout(index = ...) flat out int v_material_index;
...
layout (binding = 0) uniform GlobalUniforms
{
    mat4 ProjectionMatrix;
    mat4 ViewMatrix;
    ...
};

layout (binding = 1) buffer readonly InstanceBuffer
{
    mat4 WorldMatrix;
    ivec4 InstanceData;
};

void main()
{
    GpuInstance instance = InstanceBuffer.Instances[gl_DrawID];
    v_material_index = instance.Material.x;

    gl_Position = p * v * instance.WorldMatrix * vec4(i_position, 1.0);
}

// fs
uint NonUniformIndex(...) {
// searchbox find that function... look for BayBoyKiller's thing
}

...
layout(index = ...) flat int in v_material_index;
...

struct GpuMaterial
{
    vec4 BaseColor;
    vec4 BaseFactors; // xyzw = normal strength, metalness/roughness factor, emissive strength

    uvec2 BaseColorTextureIndex;
    uvec2 NormalTextureIndex;

    uvec2 ArmTextureIndex; // arm = ambientocclusion/roughness/metalness
    uvec2 EmissiveTextureIndex;
};

layout(binding = 0) buffer readonly MaterialBuffer
{
    GpuMaterial Materials[];
};

layout(binding = 8) sampler2Darray u_textures[8];


void main() 
{
    GpuMaterial material = MaterialBuffer.Materials[v_material_index];
    
    o_color = texture2D(u_textures[NonUniformIndex(material.BaseColorTextureIndex.x)], material.BaseColorTextureIndex.y, v_uv);
}
#

for the bindless path you can reuse the texture indices as handles and just sampler2D(...) them

#

i think i would also have 2 physical fragment shaders then, one for bindless and one for nonbindless and not do #ifdef magic, since im controlling that from my cpp code anyway whether i support bindless or not

delicate delta
#

I like that setup, a lot. I don’t have anything that fancy. That’s a nice structure.

ivory verge
#

i just noticed the instancebuffer thing is wrong up there

#
struct GpuInstance 
{
    mat4 WorldMatrix;
    ivec4 InstanceData;
};

layout(..., std430) buffer readonly InstanceBuffer
{
    GpuInstance Instances[];
}
queen hinge
#

Hey bjorn, what brands do you test on?

delicate delta
#

What type of brands do you mean?

queen hinge
#

AMD?
NVIDIA?
Intel?
Apple?
etc

#

Gpu brands

delicate delta
#

Nvidia and intel

#

I want to buy amd

#

I just have to make more progress first

queen hinge
#

AMD and NVIDIA are the most important ones to test on tbh

#

Not testing on AMD, especially with vulkan, is signing up for disaster

ivory verge
#

that applies to OpenGL as well

#

there is a lot of shit nvidia silently will just accept, which intel/amd dont

delicate delta
#

As long as it works for me I am good

#

In the off chance someone would want to run something I make it will always be MIT licensed and on GitHub but I am not supporting that use case

delicate delta
#

I don't want it to be broken on amd though tbh, I just don't have the hardware to test it on right now

#

yall if I get a linux machine will it actually work, or is linux still a meme

#

like will I be able to print stuff on a printer out of the box, can I copy text from one app to another, can I like install vs code and run my sdl vulkan app and it just works

ivory verge
#

we are all here to help 🙂 and we have different hardware too

#

i dont use printers anymore, so i cant tell, but everything else you said works

delicate delta
#

that's good, that's all I need then

ivory verge
#

printers are supposed to also work, especially older models

delicate delta
#

all I will do is use a browser, a pdf reader, and vs code

#

I am going to use DCC apps on windows, like Houdini, Blender Marmoset Maya whatever

ivory verge
#

blender works on lunix just fine too

#

linux distros can be daunting though

#

perhaps get a spare sata3 ssd, plug it in and install 2 or 3 different ones - at a time - on that one and then boot menu into that one, dont dual boot

delicate delta
#

I use linux for my dev server at work, a mac for where I code, all because I have to

#

yeah I don't want to dual boot

#

I will have a windows desktop and laptop still, this is just an extra linux amd laptop

ivory verge
#

i have windows on a dedicated ssd, linux too and games on a shared nvme

#

i use the bios boot menu to chose what to boot

delicate delta
#

ah, does that work with the TPM chip

#

that windows requires

ivory verge
#

yea

delicate delta
#

cool nice

#

do you use wayland or x windows?

ivory verge
#

i stay away from wayland, its not ready yet, i think

delicate delta
#

why?

#

oh ok good to know

#

I am hoping SDL just isolates me from that

ivory verge
#

sdl should have wayland support

#

so does glfw

delicate delta
#

getting back to writing some code

#

going to make this more interesting

#

it's just so much easier to write shaders now, man that include thing was worth the time I spent on it jfc

#

I was so miserable with my app shader abstraction

delicate delta
ivory verge
#

NURBS generator 2024

delicate delta
#

what's a nurbs

ivory verge
#

non uniform rational bsplines

#

or something like that

delicate delta
#

I'm just following the example in the book, this is a bezier surface

ivory verge
#

its splines spanned across a surface, with control points

elder kettle
#

It's like bezier surfaces but more general

ivory verge
#

yeah

#

its what you can do ezily with Tesselation shaders today ;p

delicate delta
#

yeah this has control points, and it's a tessellation shader ya

ivory verge
#

hehe

#

it was gluNurb back in the dark ages not just glunurb, also glMap/glMapGrid, glEvalCoord/glEvalMesh and friends

delicate delta
#

gonna put a texture on this 😅

ivory verge
#

crazy how much fixed pipeline crap is in opengl 😄

delicate delta
#

they had to do all that before stages were programmable yeah, and they're like lets stop adding more and let people just write these things themselves

ivory verge
#

yeah

delicate delta
#

what's a good place to find free textures?

elder kettle
#

@wild ember

#

he linked me one before I forget where it is

delicate delta
#

my notes are terrible I remember Jake shared something and I wrote it down but I can't find it now

wild ember
delicate delta
#

thank you!

wild ember
#

the first one requires a license for commercial use, but he sells them for very cheap

#

free for non commercial uses tho

delicate delta
#

yeah this is just for my little learning scene here

#

the texture in the book is too low res

wild ember
#

yeah you can get pretty good resolutions stuff at all these places

delicate delta
#

thank you so much!

delicate delta
#

and works in renderdoc pretty much automatically with no extra shader or heartaches froge_love

ivory verge
#

when you inspect stuff in renderdoc (or any other api debugger)

#

keep the events on draw/dispatch/clear/blit focused

#

everything else in between is somehow in between and might not show the ackchual state

delicate delta
#

hrm

#

what does that mean?

ivory verge
#

opengl is a state machine, and you prepare state for actual draw/dispatch commands

#

with glEnable(GL_THISORTHAT), glCullFace, glWhatever, glBindThisAndWhatnot

delicate delta
#

right

#

oh you mean the focused event

ivory verge
#

yeah

#

i apologise for my poor english

delicate delta
#

it's np

#

right, I do when I'm debugging the data, I just wanted to see the texture load

ivory verge
#

i also seem to be typing words which i didnt mean to type sometimes, idk whats wrong with me

delicate delta
#

I understood

ivory verge
#

to see if the texture loaded there is another simple trick

#

label your shit, with glObjectLabel

delicate delta
#

oh man labels and debug groups I haven't done that yet

#

that's right

ivory verge
#

and then when capturing make sure to select "Ref All Resources" or something, and then you can just go into View -> Resources, and find it there, you will also see then where its being used

delicate delta
#

thanks

ivory verge
#

debug groups is another thing, yeah, handy for grouping your commands as a visual aid in the debugger

delicate delta
#

I don't render a lot in these small scenes

ivory verge
#

thats ok

delicate delta
#

but I should use them to get used to it

ivory verge
#

but if you have stuff like "depth prepass", "geometry pass", "resolve geometry pass", "ao", "idkwhatelse"

delicate delta
#

right

ivory verge
#

not a must ofc, but its handy 🙂

delicate delta
#

this is a great video

#

instruction cache misses are an interesting topic

#

anyway

#

back to tessellation

#

that's an unfortunate thumbnail though

delicate delta
#

hrm

late jackal
#

#1147711082702589973 has competition

elder kettle
#

Moon level DLC

delicate delta
elder kettle
#

It's inverted

#

Looks like the crater rims are sunk and the crater basins are raised

delicate delta
#

hrm

#

yes I guess it was

elder kettle
#

Are the colors from normals or purely from a texture

delicate delta
#

hrm

#

it's all a texture

#

it doesn't look right still

elder kettle
#

Yeah something is strange

#

wait a minute

#

do you have an actual heightmap or are you just using the color map as the height

#

that would explain why both look wrong, it's making one side of the crater a ridge and the other side a valley

#

Go grab a proper displacement map

delicate delta
#

oh for this example the book has just the color map

#

but for the next it has a proper height map

#

I'm just following along in the book

#

that nasa site is great

delicate delta
#

let me try this next example in the book

elder kettle
#

Past project

#

but yeah you need a separate diffuse vs. heightmap

delicate delta
#

this example only has the one texture, the next has a height map, a normals map and a texture

elder kettle
#

cool

delicate delta
#

your moon looks fantastic though

elder kettle
#

Yeah ignore me then you'll get the correct results later

#

that's the heightmap

#

Actually maybe it's a normal map I forget

#

yeah it's a normal map

#

I differentiated the heightmap to get that

#

Or rather calculated the normal on it

#

Because it wasn't a very subdivided sphere it was rather coarse actually

#

no tesellation

delicate delta
#

ah

#

it looks just amazing though

#

the moon is pretty

#

Rosy wants me to pay attention to her instead of the moon though

delicate delta
#

woah I like your particles, also is that HDR?

#

that's really cool

queen hinge
#

Looks more like volumetrics to me

elder kettle
#

It's literally just a sprite on the screen lol

delicate delta
#

looks super

elder kettle
#

simple and effective

queen hinge
elder kettle
#

opened gimp > 2048x2048 black image, filters > supernova and then played with it and added a bit of dithering until it looked good

#

The magic part was using a GPU query of the number of passed samples of the sun disk to decide whether or not to draw the sprite

#

that's why it hides when the sun is occluded

#

One of those outrageously simple and effective smoke and mirror hacks that can make some sweet looking graphics

delicate delta
#

it works really well here

delicate delta
#

alright back to moon stuff