someone asked me to make a "concept to final" thread of my 4k exegfx so here it is...

it was about 3 weeks before the party and I was trying to think of what to make. while I was lying in bed I had this image of a bunch of pumpjacks "looking" toward a windmill. I put down a quick sketch in my notebook

I started by modelling the pumpjack in blender by following a cad drawing. this was to figure out the right dimensions for all the parts

then I started the slow process of modelling the whole thing in GLSL. I used shadertoy since it's easy to quickly see updates and pan around with the mouse

here's a render of the partially finished pumpjacks in a row, using a plain diffuse material. at this point I realized the ibeams were much too thick, so I had to reposition everything to account for it

I eventually decided on a plain metallic material, using the GGX BRDF. to make sure the brightness was correct, I rendered light probes in blender to an EXR file, and copied the intensity values into the shader

the grass is an infinite series of planes that are facing the camera, each with a 2D SDF for the blades of grass. after intersecting with the ground plane, there's a loop that iterates over every plane until there's a grass blade that intersects with the camera

the SDF for the blades are offset randomly based on the plane index, so what you get is grass that doesn't look too regular. requires a lot of multisampling to look good though.

here's a series of renders as I improved the grass material, which was totally just a bunch of formulas I took out of my ass, and has no physical basis to it

at this point, I ran out of both space and time 😟

also, the shader took 7 seconds to compile, locking up the process. so I used my remaining time to rewrite my 4k framework so you can quit at any moment

and after finishing touches like better colour grading, this was the final result:

one last thing is a cool function I made to quickly generate the parts of the pumpjack. I used it to make the i-beams, steel body with ridges, and ladder

@SuricrasiaOnline Ok so some graphics are done in pure shader but others are done in 3d modeling. Is that because building everything in shaders is too complex or too time consuming?

@nixfreak all the graphics are in the shader. I just do modelling in blender for reference. the only thing I use from blender are the dimensions of each object after modelling

@nixfreak modelling in the shader is time consuming, because I have to define everything from scratch (how to even render a box for example). the benefit is it runs fast and compresses very well to fit in 4k

@SuricrasiaOnline Good to know, I started reading the book of shaders and going through some of the examples but the GL_ES header isn't being found. So I need to do some more digging because I have openGL ES on this laptop.

@SuricrasiaOnline concept: decompression algorithm in the shader and the image you give it is compressed

that’s entirely useless but it would be funny i think

@SuricrasiaOnline pretty amazing you only started three weeks before the competition. So how are you able to live code glsl and compile ? Talking about three shader programmers and the DJ from demoparty.

@nixfreak there's a tool called "bonzomatic" that is a shader editor/viewer. you write code in the foreground and it shows the shader in the background. you press ctrl+r to recompile the shader

@nixfreak there's a fork of this that added network support (idk if it's in mainline) that streams the code to a server. the streamer runs three bonzomatic instances that are setup to read the code from this server. that's so the coders don't need to stream video, just the code

@SuricrasiaOnline oh ok I thought it was a loop event. So it’s a separate editor that allows you to do it.

@SuricrasiaOnline @nixfreak Bonzomatic doesn’t work on my old GPU, so I searched for alternatives, if itt can help.

GTK4-demo (included in GTK4) contains a similar tool compatible with shadertoy, but faster than this browser one.

There is also ShaderEd (sources for Linux and Windows)

I seen this week, there is a similar tool on Android too, called Shader Editor (free software available on F-Droid free softwares repository).

@popolon @SuricrasiaOnline

Awesome thanks Shadered gui worked , just needed to link the correct library `ln -s /usr/lib/` because arch only has

@nixfreak @SuricrasiaOnline

There is an AUR package shadered (shadered-bin and shadered-git too) on arch :). I'm currenly compiling shadered AUR, but it download lot of content from several git repositories.

@popolon @SuricrasiaOnline

I usually build most apps but the binary is working great for me.

Linux chaosArch 5.17.3-arch1-1

@popolon @SuricrasiaOnline

Ok so this worked now
glxinfo | grep -i opengl
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 4400 (HSW GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.0.1
OpenGL shading language version string: 3.30

@nixfreak @SuricrasiaOnline interface work for me, but browsing online available premade things crash, GL 4.1 minimum, like bonzomatic (my GPU, HD Graphics 3000, is GL 3.3 max on Mesa).
Max core profile version: 3.3
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0

@popolon @SuricrasiaOnline

I haven't tried this but looks like you can open up an external editor (default editor) and tell Shadered to recompile on save and it will show in shadered after (ctrl +s).

@popolon @SuricrasiaOnline

Yeah I found out MESA 22.0 for i965 driver for shader is 3.30 max . So you will have to use #version 330 on your shaders. @SuricrasiaOnline uses 4.20 shaders that's why I can't view his stuff like grazing.

Show newer

@SuricrasiaOnline The grass is my favourite part actually. It looks really nice and I want to walk through Pumpjack Field.

@SuricrasiaOnline see that’s a great story , I wonder if you could of transformed the pump jacks into a windmill almost like morphing into something they wanted to be. I know it’s Corny.

@SuricrasiaOnline so you use blender to create the 3D modeling than take shaders and copy over the models to have control over them? I remember watching a wireframe over objects like that.

Sign in to participate in the conversation

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!