@froyok@mastodon.gamedev.place
@froyok@mastodon.gamedev.place avatar

froyok

@froyok@mastodon.gamedev.place

Aka Lady Bloom.

Principal Product manager on Substance 3D Painter :substance:, but stay up at night to fiddle with shader stuff.

Speaking French/English.

#gamedev #art #unrealengine #substance #opengl

nobot

This profile is from a federated server and may be incomplete. Browse more on the original instance.

froyok, to gamedev
@froyok@mastodon.gamedev.place avatar

New thread: I'm building my own game engine !

The goal is to support the needs for my custom FPS game project. 😄

Feature set goal:

  • Forward(+) renderer
  • Stencil/Shadow Volumes
  • Portals (with recursion)
  • FXAA and MSAA
  • Oren-Nayar diffuse shading
  • PBR Specular/Gloss workflow
  • Fancy Post-Effects (ex natural Bloom, SSAO)
  • HDR reflections (parallax corrected cubemap) + proxies
  • Blurry glass/window (like Doom 2016)
  • Parallax/Relief mapping + shadow

froyok,
@froyok@mastodon.gamedev.place avatar

It takes 5s (1.7s parsing, 3.2s building mesh) to load an OBJ of 80K triangles currently. A bit slow, but I need to profile how Lua perform some string manipulations to see if I could improve some pain points.

froyok,
@froyok@mastodon.gamedev.place avatar

Got it down to 2.5s !
Mostly by avoiding creating lua tables and re-using them instead. So now the mesh building takes only 0.9s.

froyok,
@froyok@mastodon.gamedev.place avatar

Below 1.9 now, by improving the file parsing. :)
There are some really nice reading on Lua performance out there. Notably on string trimming for example: http://lua-users.org/wiki/StringTrim

froyok,
@froyok@mastodon.gamedev.place avatar

I also started to gather some literature.
This one is from 2010, so already a bit outdated but it provides a nice overview from what I could see while browsing it.
I also started to gather a lot of papers/publications on side.

froyok,
@froyok@mastodon.gamedev.place avatar

Got the old Sponza in !
Taking 3.4s to load however for 260K, a bit slow to my taste but not sure how to make it faster right now.
I want to check to new Sponza released by Intel as well. Will be handy to try out PBR later on.
(Yes shading is a bit wonky right now.)

froyok,
@froyok@mastodon.gamedev.place avatar

I plugged in some camera controls. Still a bit wonky to use, but at least I got the maths right. :)

Video of a fly-through camera moving around the Sponza mesh.

froyok,
@froyok@mastodon.gamedev.place avatar

That new Sponza was a bit too slow to process... so I moved the loading in a thread. 😄

Video showing meshes loading one after another while moving around in the scene.

froyok,
@froyok@mastodon.gamedev.place avatar

Spent the past few days doing research and reading about rendering. It's really cool learning about old-school stuff.

For example today I learned about the concept of "Light Pre-Pass". It's the idea of computing lighting with basic info to avoid re-rendering meshes later on in forward rendering.
(Seems difficult to use in a PBR workflow however.)

froyok,
@froyok@mastodon.gamedev.place avatar

Spending today reworking the workflow.

  • Putting obj import as a pre-process step into a custom format.
  • Started thinking about texture/material/shader management and definitions. (What I did for my 2D rpg won't scale, so I need adjustment. 🤔)
froyok,
@froyok@mastodon.gamedev.place avatar

The backend for loading materials (shader + texture + parameter) is in good progress... but looks like my TBN are a bit wonky. 🤪

froyok,
@froyok@mastodon.gamedev.place avatar

Plenty of wonky stuff were going on, but this is now solved. Main issue was that I wasn't converting the normal map to DDS properly ("-tonormal" vs "-normal" on Nvidia command line tool 🤦‍♀️).

froyok,
@froyok@mastodon.gamedev.place avatar

Oh yeah, and the mesh UVs were flipped on the Y axis...... Had to patch the mesh builder.

froyok,
@froyok@mastodon.gamedev.place avatar

I just spent two days on a bug, thinking my shaders or mesh generation code could be broken... turns out the issue was coming from my normal maps mipmaps.
They are borked somehow. 🙄

Look at how the lighting change when afar (close-up is the right result) :

video/mp4

froyok,
@froyok@mastodon.gamedev.place avatar

No mipmaps:

video/mp4

froyok,
@froyok@mastodon.gamedev.place avatar

Now I need to figure out why they are borked.

  • Wrong loading of the DDS file ?
  • Wrong generation of the DDS by Nvidia tools ?
froyok,
@froyok@mastodon.gamedev.place avatar

It's the Nvidia tools. 🥳

Checked the DDS in RenderDoc and the drop to the first mip is breaking up the values.

Looks like AMD Compressonator works fine meanwhile.

froyok,
@froyok@mastodon.gamedev.place avatar

Somebody pointed out to me Cuttlefish, which is a DDS converted based on Compressonator but doesn't have the issues related to it. Seems to be working fine ! :)
https://github.com/akb825/Cuttlefish

froyok,
@froyok@mastodon.gamedev.place avatar

Heeyyy ! Shading ! :D
(Turns out the mipmap bug wasn't the real issue, but the fact I flipped the UVs before generating the TBN)

froyok,
@froyok@mastodon.gamedev.place avatar

Right now my TBN generation is quite wonky, so I need to look into something else.
Thinking about writing a custom exporter for Blender. Blender scripting support batching so that should make things easy.

froyok,
@froyok@mastodon.gamedev.place avatar

Been doing more reading the last few days (hard to do more, lots of stuff at work these days).

Still working on the material/shader system. I'm going toward building uber shaders + define sets as primary/parent materials.
Then scene assets reference child materials that are just tweaked parameters of those parent ones.

froyok,
@froyok@mastodon.gamedev.place avatar

All of this led me to the notion of "dynamic branch" vs "static branch" in shaders.

I didn't know that "static branches" were actually uniforms set before using the shader for drawing. So basically variables that don't change while it is drawn. Always thought it meant the use of defines.

It shows well how much Unreal material system is obscure, most of my knowledge comes from here. 😅

froyok,
@froyok@mastodon.gamedev.place avatar

That made me re-read this really cool article from Dolphin-emu:
"Ubershaders: A Ridiculous Solution to an Impossible Problem"
https://dolphin-emu.org/blog/2017/07/30/ubershaders/

froyok,
@froyok@mastodon.gamedev.place avatar

Took a bit of work and fiddling, but I finally finished implementing the "material" system, and everything is up running again.

(I should start setting an svn repo for this project. 😅 )

froyok,
@froyok@mastodon.gamedev.place avatar

Having a wild evening working on a custom exporter, learning occult stuff about Blender. 🙃

froyok,
@froyok@mastodon.gamedev.place avatar

Yeay ! Got it working (in an ugly way, but will optimize another day) and now I have TBN exported from Blender directly.

No more wonky generation on my side and I can support the Mikk tangent space. So I will be able to properly bake in Painter. :)

Example here with mirrored UVs:

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • GTA5RPClips
  • provamag3
  • InstantRegret
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • lostlight
  • All magazines