#Dark Messiah of Might and Magic

1 messages Β· Page 1 of 1 (latest)

lament jacinth
#

UPDATE: Follow instructions on the wiki to download and try it yourself!
https://wiki.wiltostech.com/3/DMRTX

Spent a while patching the Dark Messiah game to work properly with DX7 and DX8. From there I installed the Portal RTX distributions (the rtx-remix one doesn't really work) and am now going to start getting this moving forward!

#

You can launch Dark Messiah in windowed mode by using -dev -windowed, arkane has added the -dev as a requirement. This fixes launch crashes.

#

Comes from

solemn quiver
#

Have you tried borderless windowed mode with it? Use borderless gaming, might be a good alt to fullscreen

lament jacinth
#

There's no reason, these are launch parameters

#

The launch parameters I gave is windowed mode on launch

#

the only addition is -dev

sleek sparrow
#

light messiah

#

your name: john messiah, your mission: shoot sword and stop the evil wizard known as Raymond Tracing

vocal roost
#

which method did you use to inject rtxremix? hl2/portal method?

tacit lantern
#

send a guide on how we can run it with remix

vocal roost
#

ok im now getting this error

oak turtle
sleek sparrow
#

He patched the game himself

#

It doesn't support DX7/8 by default

#

He's been reverse engineering the game to add coop to it for some time now

#

I think you're gonna have to wait for additional files before you too can run it with Remix

rose dune
serene gale
lament jacinth
#

So in terms of where to put the files I am installing it to root of Dark Messiah with the mm.exe , but the package is the Portal RTX .trex, d3d9, etc. You can not take any of the source engine binaries with you because you'd be trying to merge 2013 binaries and entries to a 2006-ish engine

lament jacinth
# sleek sparrow He patched the game himself

What merc said here is true. I've been reverse engineering this game for the better of 4 years now. The patch you can pull off is basically the same patch as the source engine tweak repo regarding the Mesh vertex issue. The complication is the materialsystem, as these are basically handled slightly differently for whatever lighting system they were trying to put into the game when they were working on the engine while it was young

#

So I have been handling certain material types manually as they come in. I've still got to validate whether my solution is good because some materials have bad alpha channels and I'm not really sure if that's from RTX or the way I added support

#

I'll get some files and a repo together this weekend

lament jacinth
serene gale
#

However its either a black screen or it passed the original renderer

lament jacinth
#

But can you set dxlevel to 7 or 8m

#

?

serene gale
#

Nope

#

Sadly

lament jacinth
#

Even without RTX installed? That's what I mean by the launch parameters

#

If it straight up doesn't have them in the material system you are going to have issues

serene gale
vocal roost
#

so I checked my files and I cannot see anything that had hl2

#

@lament jacinthmy current launch param is +exec autoexec.cfg -dev -windowed

#

and then put the Portal RTX files in the usual place but when the step says, place files in HL2Bin I put them next to the exe instead

vocal roost
vocal roost
#

just wanted to say that I appreciate the work you have been putting in, King David.

empty tartan
#

I thought the Source instructions in what basically gets turned on instead for FFP was messed up.

#

I also remember seeing inordinary amount of things with no FFP fallback even in comparison to HL2

#

This is a video list containing information and graphical representations of the different over- and bottom- water texture materials currently present within Dark Messiah of Might and Magic Single Player.

The name is of the material that collects textures and sets necessary variables for creating the water "texture" currently shown within the v...

β–Ά Play video
#

I thought just every effect/water/smoke/etc created for game was basically missing. DX8 doesn't need the fallbacks but DX7 means its a literal void.

cold bison
#

Hi, any progression from last attempt?
I've tried by mysefl, but I have 3050 so I don't see any good difference.
May be dx7 is an issue.πŸ₯² idk

lament jacinth
#

Sorry I have been extremely busy at my job for the last few months. Didn't even have time to do the co-op mod updates let alone RTX. I'm going to just push out all the binaries I have to get DX7 working and then provide assistance with patches

#

Give me a ping on Friday if it's not out by then please

tacit lantern
#

Remix supports some form of shaders now so you can try it without the patches if you want to

empty tartan
#

I imagine that if they werent - everyone would know

#

Not saying it can't/won't be done but its alot of games we are talking about

lament jacinth
#

Tested it real quick with the latest bridge + DXVK and yeah

#

the world turns into water (not literally)

#

Are there particular settings to enable the shader support? I think most are on by default

empty tartan
#

Even need for speed underground which I see images pop up with is very small amount of shaders and even then I "know" things arent working like no headlights

#

probably more but I havent looked into it

#

Games like fallout,oblivion are kind of hobbling around figuring out stuff but its nowhere near 100% compatible

#

Its kind of a time thing and people wanting desperately to work so who knows whats the best approach waiting or dx7

#

Remix went opensource with no intention of supporting shaders then a few weeks later progress happened

#

That said I am sure someone is desperately trying to get portal 2 to work so who knows

lament jacinth
#

Yeah I think that if anyone wants to mess around with Dark messiah they're gonna have to use these DX7 patches. There's thing still missing like water (because it is 100% shader based but you can also just replace the water material) and transparency gets really stupid on certain materials but other than that it seems to be full formed

#

Smoke from bonfire or chimneys == dumb mat, but again CAN be replaced

empty tartan
#

I imagine all the effects dont have fallbacks

#

Like spells, fire, etc

lament jacinth
#

Nah those work fine

empty tartan
#

Welp I was wrong

#

thats not bad

#

Tbh, then it doesnt sound much different then the other source games - I thought it was a lot more busted

lament jacinth
#

It actually works IMPRESSIVELY well with spells, like the flame arrow for example emits a dynamic light anyway so remix really knows how to work with that

empty tartan
#

So whatever solutions they use probably apply

lament jacinth
#

But other than that yeah I did apply I'd say 90% of what the source patches repo had logged

#

The ball buster is just that dark messiah HATES DX7. It will not launch, and patching all those parts to work is where the effort went

empty tartan
#

Didnt blueamulet patch culling in other soruce games?

lament jacinth
#

Is this still the up to date thing to look at ?

#

c_frustumcull, r_forcenovis, r_frustumcullworld (world only), and failed to lock vertex buffer in CMeshDX8::LockVertexBuffer were all applicable but in different spots and bases

#

For example the novis part actually is a 2 step set in Dark messiah

#

There's some extra flags added to the rendering

#

So you have to bypass that before you get the novis to actually apply

empty tartan
#

Well beyond me. Maybe as progress pops up maybe someone will be interested enough that knows that type of thing

#

generally how it goes

lament jacinth
#

What i'm mentioning here is stuff I've already completed, you mentioned blue amulet having patches and I just want to make sure I am still looking at the right resource for that

empty tartan
lament jacinth
#

All good all good just want to be sure πŸ™‚

vocal roost
#

I tried Eye Divine cybermancy and its the same thing. Water is broken, as well as some particle emitters

#

With this information I will probably try and go ahead with more Dark messiah stuff

#

@lament jacinth Did you see my message earlier?

lament jacinth
lament jacinth
#

I know I'm late as hell but I'm hoping next week to push out this compatability patch stuff. I'm just trying to do my part to make sure I document as much as possible and I've set up a wiki I'll be populating here: https://wiki.wiltostech.com/3/DMRTX

#

Reason I'm linking it is because I actually think have a wiki like this for the RTX Remix process and each setting in general would be REALLY GOOD

#

and I'd be happy to host it on this site if people want to set up the articles and stuff

#

@old halo would that be something useful for you? Might be better to talk about it outside of this thread but yeah just wanted to throw it out there. I could easily set you up as an admin on that wiki so you can add trusted peeps to make the articles

old halo
#

it's great that you set something up though

lament jacinth
#

Fair

old halo
#

also i don't really know anyone that could contribute. if someone asks about contributing to a wiki, i'll point them in your direction though

lament jacinth
#

Yeah I'm thinking once I get this up for dark Messiah I will just make a separate thread in this discord for people that would want to contribute. At least until the RTX remix stuff has full proper documentation

old halo
#

ya, makes sense

vocal roost
vocal roost
#

im also interested in helping out with Dark Messiah too

lament jacinth
#

Alright so I've cleaned up every single lightleak possible and removed all the built in culling

serene gale
#

Uhm.. wouldnt that be extremely laggy?

#

Rendering the entire map at once?

lament jacinth
#

Seems to run fine even on the more intensive maps

#

I guess I should clarify

serene gale
#

Are you using portal rtx runtime? Or the latest ones

lament jacinth
#

frustrum based culling mostly

celest oriole
#

Plus if I'm not mistaken, you can use coherent noise to introduce distance culling.

lament jacinth
#

Yeah the objective is to try and push as much control onto the remix kit but not break the PC. My bad for the little too extreme description πŸ˜› but it feels like it because DM had a lot of inline functions which got broken down, plus this built in alpha fader

#

The only problem I have left now is it seems like some lights just dont turn on until an entity passes near them?

#

dunno if anyone has experienced anything like this in the other source games

#

I'll get an example in a bit just grabbing dinner

#

I was thinking that the lights might be culled in a different way (or they are auto disabled maybe?)

#

Once they TURN ON it seems like they stay on though

lament jacinth
#

I just can't get it to load in any other way

serene gale
lament jacinth
#

No, that's where I was defining it

#

I am keeping track of that

#

the game just goes back to desktop 0.00000000001ms after launching

#

it simply can not load in

lament jacinth
#

Alright so to explain the light issue

#

here is a test map

#

This room is dark as fuck

#

but it shouldnt be

#

there are boxes in there with diff lights

#

actually this isn't even all the lights, these are just the areas i walked into

#

here's what it SHOULD look like

#

Actually now that I disable the bridge and look.. this is an RTX issue not a DM issue?

#

Any ideas why THIS would happen then

lament jacinth
# lament jacinth

The lights turn themselves off unless anti light culling is set on in the experimental tab

lament jacinth
#

@fathom bolt Any ideas boss? I can see in the menu under the lighting tab that the number of lights is going up (when I get near, and the light starts emitting) and then back down (when I get some distance away)

#

It's the last thing minus giving the textures a pass

fathom bolt
#

that's a game problem - if the game isn't sending lights to remix, remix doesn't know about the lights. anti culling can only attempt to keep them around once Remix has seen them

lament jacinth
#

are these colors just baked into the map and I'm getting an illusion of the light being on?

#

I'll try to just force lights to always transmit to the client might be some weird things happening there

fathom bolt
#

oh, in the remix shot are you standing in the same place, and those cubbies are just dark? that could easily be baked lighting, I know early source engine actually did vertex based software lighting too.

#

there might be a console parameter to make it use fixed function lights

#

(a video would make what you're talking about a lot easier to understand)

lament jacinth
#

I'll get you two, one moment

#

here's the same thing but now without RTX. I also used r_drawlightsinfo so you can see these are indeed lights in those locations

#

Also excuse me for some reason it decided to cap my entire desktop on that one lol

#

A possibility I can think of is that dark messiah is restricting how many active lights there can be

#

I know that there are bypassing to the r_worldlights max you can set based on DX level and it's possible since DX7 got no work done on it I might have to just make it use the concommand

#

But I hope that video gives a better idea

#

Here's one more map that's really obvious and why I'm trying to solve this

#

VS with RTX on

celest oriole
#

Is there a way to see only active lights in rasterized mode? If I had to guess it's transitioning from baked lights to dynamic lights as you approach it, with the original baked light stripped out of the RTX view.

#

In fact it looks like the light fixture object with the corona is the source of said active light.

fathom bolt
#

One way is to take out a weapon and see what lights actually cast light on that weapon

#

or any other dynamic object

celest oriole
#

The light rendering starts the moment the corona disappears on that light fixture.

lament jacinth
#

Also Mark, if I put an object there the light turns on. In that second map a guard walks by that you can see in through the grates if you enter the door on your left. Let me get a vid of that

#

I don't even have to be THERE for it to turn on just some entity

#

But that doesn't happen in regular DM

#

IT's always on that way

celest oriole
#

Oh wow, that's really interesting. It sounds like the game itself has some kind of logic to only call the light into existence when an object walks within a trigger radius.

lament jacinth
#

I'll get a vid of that for documentation purposes

fathom bolt
#

so, it sounds like it's only turning on the fixed function light when there's a dynamic object close to the light that can be lit by it, and it's relying on baked lights for everything else

lament jacinth
#

80mb video give it a min

#

I should really drop the res on sharex :\

#

Sorry if you're using mobile dat

fathom bolt
lament jacinth
#

I'll do some research on that

#

I thought I Got all the DLights active

fathom bolt
#

if you check out the config files that shipped with Portal RTX, I believe there's some setting that disabled that behavior. I don't know it off the top of my head

lament jacinth
#

Will do!

fathom bolt
#

(and I'm talking about the source engine config files, not rtx.conf or dxvk.conf)

lament jacinth
#

Found it, the autoexec I assume

#

I'm a little scared since this game is uh deep olden source engine that half these commands won't exist

#

but it's agood lead for me

#

I appreciate the help

fathom bolt
#

Goodluck!

lament jacinth
#

Alright so is there any way to pass the light data I'm getting from the BSPs directly up to remix so it can calculate lights, or does it need to go through source first?

#

I can easily loop through all the worldlights and just send them up if I knew there was some API or something to get through

#

Found the function tree, will mess with it

lament jacinth
#

Alright i absolutely hate the solution I had to take here

#

TL;DR

#

Worldlight limit for dark messiah is HARD capped at 2

#

couldn't get the lights to render properly as it was being culled so it needed independent objects on each light

#

So I added some code to my module to spawn a tiny prop_dynamic triangle with it's texture set to a custom one that is ignored by RTX, on every light in the map

#

Works well!

#

I opted out of using the build in anti-light cull because that also keeps lights that are being spawned from spells

#

this entirely dedicates itself to map-spawned static lighting, so RTX can handle the dynamically spawned and activated ones

#

This also doesn't fuck with any values of the light so if the light is off, she stays off

wild valve
#

and it can already be turned on with rtx and pass without artifacts?

lament jacinth
#

The lights aren't producing artifacts no. The only thing left to do now is pass through the textures to make them better for remix to work with. That much I can't do. I've done all the programmatic stuff to get the game working in DX7 + culling fixes + other tweaks like this worldlight issue

#

Like setting certain textures as terrain works great on some maps but then gets like you see the floor there

#

I assume because it's not really "RTX READY"

#

So with this all working I can now finalize packing this up for other people to mess with

wild valve
#

and your work on dx7 will work in games where dx7?

lament jacinth
#

No, these are strictly compatability added to dark messiah. The module I have is being applied TO dark messiah. But the steps I'm taking here could easily be replicated in other source engine games though the location will differ similar to how Blue Amulets source tweaks are listed

lament jacinth
#

I'm just throwing the RTX patch into the wild. Here's a link for now while I get everything else prepped up (better instructions, different packages, etc): https://knockout.chat/thread/13854/17#post-1908503

I'm sure the people here are smart enough to get it going with the simpler instructions! Backup the mm.exe, get the contents, and just extract. You'll need to put in the launch parameters, but other than that it'll run. Let me know if any maps crash on launch as I'm still working my way through them on DX7

#

The download there includes DXVK and the bridge client. Feel free to update DXVK, the bridge client needs to stay as it is or it won't launch

wooden bane
#

How it's going

lament jacinth
#

See above, people who want to start messing with it can

#

Trying to find all the maps that crash ATM

wooden bane
#

Bridge crashes during the intro to the story :/

#

Loading a map with console works

wooden bane
#

This game with remix is just awesome

#

Only the head is missing

lament jacinth
#

Did you use the launch parameters on the wiki?

lament jacinth
#

?

serene gale
lament jacinth
#

THAT would make more sense lol

#

But I'm doubtful, unless the launch parameters weren't used. That's the first map I played. There's a bug with the rendering in the shantiri room which causes it to bleed into the intro cinematic

#

Which DXVK are you using as well?

wooden bane
wooden bane
#

I couldn't get foss version working

lament jacinth
#

Foss?

#

I'll check the level out later today btw

#

currently heading out to work

#

so I'll get back to ya

wooden bane
lament jacinth
#

Alright @wooden bane I went in and tried to instigate a crash

#

I got nothing

#

Could you take a screenshot of this menu? Options -> Video -> Advanced

#

this is the bug you'll see in that intro BTW, that wall that seperates that cutscene just breaks in DX7. I am currently trying to pinpoint the exact shader and make a low-end equivalent in the module

lament jacinth
#

I updated the wiki with better instructions on how to install, and there is a quickstart area: https://wiki.wiltostech.com/3/DMRTX

I've also included the STANDALONE modules for dark messiah incase people want to go through the installation step by step. Like I said in the wiki, if you decide to use the All In One solution you can still install independently update DXVK or the remix bridge, just follow their respective pages!

#

I added that link up the OP as well

lament jacinth
#

@wooden bane Sorry to ping you but if you had the time to send me a screenshot of your options I'd appreciate it! Just want to pinpoint that bug before I push an update

wooden bane
lament jacinth
#

Cheers, means I gotta try some other avenues out to get it to crash

wooden bane
lament jacinth
#

yeah doubtful, I'd honestly be more convinced it's SOMEHOW the game's resolution but I also doubt that too. Basically something is making my fallback textures not load

celest oriole
#

Finally had a chance to give your mod a test-- I'm absolutely floored.

lament jacinth
#

I think I found that how to fix the graphical bugs in that area, though I wouldn't expect the patch until this weekend

#

Happy to hear you're enjoying it ( and it didn't crash on you, thank God )

#

Really hope someone comes around and starts making those textures, and has the patience to also teach me how to do them

celest oriole
#

I know the basics of the texture formatting and would love to help with the conf where I can, so far the only bug as far as stability is concerned is the fact that it didn't ever reach the main menu for me-- it gave me an error instead and left me on a blank screen. I had to load map l00 instead to start playing.

Not really in a position to work on Remix right now but my first priority is basically putting up all of my work from other games so someone more experienced can take the reins, then I want to take the time to learn Substance so I can start making high quality replacements.

wooden bane
#

@lament jacinth Have you been able to get this working with latest builds of remix?

lament jacinth
#

DXVK or bridge?

wooden bane
lament jacinth
#

DXVK tends to work, the bridge has always had issues but I haven't tried the LATEST LATEST

#

I will have a look

wooden bane
lament jacinth
#

That's the way I packed it

lament jacinth
#

I do wonder what makes the portal bridge so special that it doesn't instantly close the game when it hooks in

wooden bane
#

Better ask Mark

lament jacinth
#

wrong mark lmfao hold on

#

@fathom bolt

#

Now we got em

#

Your wisdom is needed!

neat rivet
#

Nah man I got this (I don’t)

#

Excited for Dark Messiah RTX though

fathom bolt
#

more recent bridge builds should have more error checking, so if something is going wrong it will crash and log a useful error, instead of just running for a while and crashing when the memory gets corrupted later on. Do you get .dmp files or anything in any of the log files?

lament jacinth
#

I'll get you some of the log, but there's no dmp produced. Basically when I hit play game (or launch the exe directly), it will look like it's loading but then never ACTUALLY open the game, and shut the exe down

fathom bolt
#

any log or dmp in the .trex folder?

lament jacinth
#

Here's the logs in the same folder as the mm.exe

#

Here's the .trex log

#

No dump

fathom bolt
#

that's using the latest bridge?

wooden bane
lament jacinth
#

this is the exact one I downloaded

wooden bane
lament jacinth
#

Let me do a clean install real quick

wooden bane
lament jacinth
#

Alright good to know hah

#

I welcome my own fucking up

#

But yeah, any version of DXVK works fine. it's literally just the BRIDGE that causes the issues

wooden bane
#

Do steam show the exit code somewhere

#

[01:22:35.228] info: D3D9 Module destroyed.

fathom bolt
#

Have you made a github issue about this?

lament jacinth
#

I haven't no, I can get on that

#

Should this be on the bridge itself or on the combined repo?

fathom bolt
#

we prefer tickets to be on the combined repo

lament jacinth
lament jacinth
#

A pretty cave!

vocal roost
#

nice to see progress with this

#

super excitting stuff

cedar sun
fast sable
#

that looks great ! this game has the best medieval FPS gameplay still, with all the great physics interactions and orientated charged attacks

would wish so bad for a full remake ! not sure if RTX Remix would also be able to upgrade every assets

wooden bane
lament jacinth
#

Even just moving this to the 2013 branch of source would do wonders for it

#

And if you don't care about RTX, there's always S2, but we do like our RTX around here πŸ₯‚

fast sable
#

what is S2?

celest oriole
#

Source 2, I assume?

#

What I do love about Remix is that, at least as far as I've seen, it really blows those engine-level model limitations out of the water when it comes to replacements. It's everything I could ask for from a limit raising source port but somehow engine-agnostic.

#

Too bad we don't have a workflow for skinned replacements yet... πŸ₯Ή soon.

fathom bolt
#

As long as the skeleton the asset is using matches the skeleton that the game sends to the gpu, skinned asset replacement should work.

Though do be careful - at least in Prelude and HL2 I've dealt with a lot of issues where the model and animation have mismatching skeletons. And some source engine skeletons are defined in orders that FBX fundamentally doesn't support, which also causes problems.

#

Well, and the game needs to be using GPU skinning... which is actually pretty rare. If a USD capture includes a skeleton, then that asset can be replaced with skinning intact

lament jacinth
#

That is some GOOD intel regarding the skeleton.. I really have to start messing with the omniverse app

lament jacinth
#

I'm trying to get some remastered textures going, but I keep getting err: USD mod file failed parsing

#

I see it gets encountered ever so often

#

is this because I'm still using the old Portal RTX bridge client?

#

The USDA is very barebones

(
    customLayerData = {
        string lightspeed_game_name = "mod"
        string lightspeed_layer_type = "replacement"
        string remix_replacement_status = "Release Ready"
    }
    metersPerUnit = 0.01
    subLayers = [
        @./replacements.usda@
    ]
    upAxis = "Z"
)```
#

I've also tried using the Portal Prelude RTX mod.usda file, no luck

wooden bane
#

It must be UTF-8

lament jacinth
#

Appears so:

#

Does it have to be CRLF?

wooden bane
wooden bane
lament jacinth
#

I can try notepad++

#

I can CHANGE it to UTF-8 BOM but as it stands it's just regular UTF-8

wooden bane
#

So you reference to another usda, does it have the same properties as well?

lament jacinth
#

Yep, exact same. UTF-8, LF, and I CAN change to BOM

wooden bane
wooden bane
lament jacinth
lament jacinth
#

The only old thing is the bridge client until that issue gets resolved

wooden bane
lament jacinth
#

Damn

#

But you DID solve it right

#

tell me good news 😒

wooden bane
wooden bane
#

but yours look ok

lament jacinth
#

Ahhhh, welp lol

#

Is there an alternative way to load the replacements? Like using the LSS plugins or something

#

I see Portal RTX used "gamereadyassets"

wooden bane
lament jacinth
#

E:\Program Files\Steam\steamapps\common\Dark Messiah Might and Magic Single Player\rtx-remix\mods\gameReadyAssets\mod.usda

#

That' one is mine

#

and now portal RTX uses

#

E:\Program Files\Steam\steamapps\common\PortalRTX\lss\gameReadyAssets\replacements.usda

#

But if it's not the bridge client that does this then I don't think there's any issue with pathing. I think I saw mark mention something about perms at some point but I have no idea WHY that would get in the way. This is a Windows 10 system. I could try running in admin just to really push it but IDK

wooden bane
#

I wish the parsing error had more detail

lament jacinth
#

Yeahhhhhhhhhhhh

wooden bane
#

Do you have usd-composer installed?

lament jacinth
#

No but I could get that real quick

wooden bane
#

I wonder if it shows a detailed error

#

Can you send me the files? I can see right now

lament jacinth
#

You want the replacement as well?

wooden bane
lament jacinth
wooden bane
#

Hmm they're fine indeed

#

So it is the runtime failing to do

lament jacinth
#

Should I reset my rtx.conf?

wooden bane
#

But if it did someone else probably would find out

lament jacinth
#

What build are you using, I'll swap over

wooden bane
#

Guess what

#

mine doesn't parse my mods either

#

which was working fine few days ago

lament jacinth
#

It's time to D-D-D-DOWNGRADE

#

unless you never updated

#

This wouldn't somehow be to do with the latest nvidia driver?

#

One just got released on 9/12

wooden bane
#

so every game I have gets updated as I update one

wooden bane
#

I will downgrade & try again

lament jacinth
wooden bane
#

Uhm wrong one

lament jacinth
#

Just putting here that this was resolved by making sure you have a USD folder from the rtx-remix release build in your .trex folder! This also resolves crashing from using the CAPTURE SCENE / CAPTURE ASSETS button

#

The only additional crash I'm seeing is that when I have enhanced asset enable on map load, it crashes the bridge (game is intact but frozen display, like you can still move around but can't see any more than the last thing you saw), so I had to disable it then load map

#

and re-enable in the map

wooden bane
fathom bolt
#

FYI - not sure if Dark Messiah uses the 3d skybox, but if it does it'd be a good idea to try this instead of disabling it #1116089843479498782 message

lament jacinth
fathom bolt
#

Well I thought it was fully implemented and ready to go, but as soon as I started telling people about it we got a bug report πŸ™‚
#1116089843479498782 message

#

If it's looking good in your game though, I'd go ahead and use it

lament jacinth
#

Classic software development

#

I've tested with almost all the maps and it seems to work pretty well, though some maps the texture just looks a bit better. Not related to the tool more the quality of the skybox

fathom bolt
#

yeah, not surprising, but it's at least one less thing from the original game we have to disable. I know if HL2 you lose some of the effects around the citadel if you have 3dsky disabled

serene gale
fathom bolt
#

I thought the 2d sky had a painted in citadel

sleek sparrow
#

Nah it's always a 3D model

#

One of several models actually

#

One is full scale and static, one is full scale and animated

#

And another is static and has a gradient fade out texture to blend with the clouds

#

Off the top of my head ofc

#

Probably off by a bit

#

oh and can't forget the unused one where it's a baked anim of it exploding

lament jacinth
#

So at the moment I'm working with @hearty fox on getting at least the original source normal maps into the right format. He was asking about converting file hashes so we can identify the name of the texture from remix's capture and just streamline the process but since it's generated from raw data as Mark said, that's not possible. That leaves the only option to automating image comparison. Anyone know if there's something already made for that or am I going to have to really use machine vision for this lol

#

Like we can take all the VTF files, convert to png, look at capture and check

#

Like STACK OVERFLOWℒ️ says I can use a lib but by name it also seems to rely on hashing which scares me

#

Maybe I'll try it just to see

#

LMAO welp next time I should just try it instead of looking like a dumbass for asking because it DOES work and pretty well. @hearty fox I will set up some scripts for you to run and you should be able to just loop through all the exported dds files and match them to VTFs

hearty fox
#

So we don't have to match the textures by eye anymore?

#

LIKE CAVEMAN?

lament jacinth
#

Absolutely, I think we can pull a lot of information from the game to at least give a ballpark texture before artpasses. There's certain sprites that DEFINITELY need to be remade though

#

Also why is that gif 2 frames

hearty fox
#

And why isn't one of the frames him hitting the table

fathom bolt
#

generated from raw data as Mark said, that's not possible.

#

Note that it doesn't mean it's impossible, just that you have to figure out how to convert the game's texture files into the raw data they would send to the GPU

#

that often just involves opening the file and getting a pixel array out of it, then hashing that pixel array

#

though mipmapping may make that more complex, as you may have to hash it from a lower mip level if the game is using lower texture quality

lament jacinth
#

I actually got it figured out with that code up there

#

that imagehash library does wonders

#

Wrote something up that just let's me put the DDS in and it'll spit out the path and any additional things for that file (VMT, normals)

old halo
lament jacinth
old halo
#

it matches though? if it doesn't for you, that's extremely odd

lament jacinth
#

For example: 327664AFC1C78496 vs my actual EE29DEE34EB633CD

old halo
#

i know a few people use that script and have matching hashes

#

i'm not sure what'd be causing the difference

lament jacinth
#

Neither do I boss, just letting you know what's happening

#

Those are the two of em

old halo
#

did you dump that vtf file right from the game? if the image isn't identical to what Remix is outputting, the hash will be different. some games store them different to what Remix outputs, whereas other games have it the exact same. i don't fully understand Remix's capture system unfortunately

lament jacinth
#

The VTF is from the VPKs directly yeah

lament jacinth
#

I feel like it has to be a difference in the VTF structure

#

For example 33554944 80 as being dwWidth and dwHeight seems..... offf

#

this is what the texture looks like

#

I'll mess around with the header

lament jacinth
#

I had to modify the dwidth and dwheight too since they were reading as ints when they are actually shorts

lament jacinth
#
DXT1_FORMAT = 13
DXT3_FORMAT = 14
DXT5_FORMAT = 15
def generate_VTF72_hash(file_path ) -> str:
    file_size = os.path.getsize( file_path )

    with open(file_path, "rb") as file:
        data = file.read(80)

    sig = data[0:4]
    major_ver = int.from_bytes(data[4:8], "little")
    minor_ver = int.from_bytes(data[8:12], "little")

    header_size = int.from_bytes(data[12:16], "little")
    pfFlags = int.from_bytes(data[20:24], "little")
    mipmap_count = int.from_bytes(data[56:57], "little")
    lowWidth = int.from_bytes(data[61:62], "little")
    lowHeight = int.from_bytes(data[62:63], "little")

    dwWidth = int.from_bytes(data[16:18], "little")
    dwHeight = int.from_bytes(data[18:20], "little")
    highres_format = int.from_bytes(data[52:56], "little")

    act_width = ( dwWidth / 4 )
    act_height = ( dwHeight / 4 )
    mipsize = int( act_width * act_height )
    if highres_format == DXT1_FORMAT:
        mipsize *= 8
    elif highres_format == DXT5_FORMAT:
        mipsize *= 16

    with open(file_path, "rb") as file:
        file.seek(file_size - mipsize)
        data = file.read(mipsize)
    hash_value = xxhash.xxh3_64(data).hexdigest()
    return hash_value.upper()```

Some inspiration for your implementation @old halo
#

This should work with all VTF < 7.3 (7.2, 7.1)

old halo
#

very nice, thanks

wooden bane
#

So the generated hashes from the textures on disk match the ones remix generates?

vocal roost
#

was there something specifc you did to find out the VTF Header version?

#

this is very interesting

serene gale
#

@lament jacinth did you modify the source engine light limit?

#

If yes, can i know how exactly? So we can apply it to other source engine games :3

lament jacinth
#

In my case it's the max width max height mipmap

vocal roost
#

I think I have that data somewhere

lament jacinth
#

What I did instead is make sure every light is active and has a reason to be active and be calculated. Like I said above I don't have the ability to mess with the max light console command, so I had to put down an entity for every light basically, and make it invisible. That keeps it from being averaged out or just not transmitted

#

If you scroll up a bit you'll see the problem, where certain lights should only turn on when something is near it. If it's within the limits, it'll stay on, but for the most part it'll turn itself back off once you leave it

#

In my case keeping an entity nearby was the thing to do it

#

So in my module it loops through the world lights and places one at the origin of each light

#

Thankfully the remix kit lets you select textures to be ignored, so I just selected my custom light entity texture

serene gale
#

Hmm

#

Thats interesting

#

Afair they removed the lights limit in portal rtx

#

Not sure tho

vocal roost
serene gale
#

Its a very annoying issue in source engine games as a whole

#

Visible here

lament jacinth
#

Is there a timestamp to that video

lament jacinth
serene gale
lament jacinth
#

I didn't realize this propagated so much

#

I bet if you got that exact position and spawned an entity there, the light would already be on right?

serene gale
#

We would need to do further testing to see if spawning an entity could help

#

At least in Garry's mod case

lament jacinth
#

I mean the beauty is this is Garry's mod just write a quick Lua script to spawn something when the map starts at that exact position, even if it's hard coded

#

Could just be on the floor underneath the light, it just needs to be in range

#

Shouldn't take more than a few minutes, ents.create and setpos the sucker

#

You've already tried the r_maxlights or whatever the console command is?

wooden bane
lament jacinth
#

Okay so you're having the issue I had then verbatim

#

Basically there's a thousand positions for the max lights so it's very difficult to patch this. You've got stuff in the material system, you've got stuff in the engine, this is all usually just a single variable when you're doing this work, but it gets integrated directly into functions when compiled instead of staying as a pointer

#

If you patch one thing, and don't patch the rest you're still going to be clamped by the limit, or worse, you're going to have crashes because the material system functions preset their array variables to have the max light size that they were compiled with

#

So you're going to end up reading outside of the expected limitations, or misaligning the function

#

Args

#

The shortest path forward to me was the solution above, and is pretty consistently available information

#

All you need to do now is get create entity functions and spawn it in

#

And also get the engine world light count and position

wooden bane
#

Yea all these sound alien to me πŸ™‚

lament jacinth
#

hah

#

Well I've yet to find an easier way but then again I'm burdened by a 15 year old game

fathom bolt
#

Note that to overcome the max lighting in portal.. in a lot of cases we just disabled most of the in game lights and manually placed our own lighting anchored to various bits of geometry.

lament jacinth
#

That literally sounds like what I had to do so glad to hear it's consistent lmao

fathom bolt
#

not exactly a process that will work when you don't have a well known and static list of maps

lament jacinth
#

Old mapping trick to put a bottle in your room to stop the light from turning off ironically

fathom bolt
#

yeah, dynamic lighting was very expensive in this generation of games, so they used all sorts of tricks to reduce the number of lights

#

Remix will automatically try to keep around lights that the game starts culling, but that doesn't help when the game doesn't start drawing that light in the first place

#

You can do a lot by just attaching lights to torches, fireplaces, and other meshes that should emit light, and then adding a bunch of those in places where the in game lighting is spotty.

Then just turn the intensity of the original lights down to 0 to disable them.

serene gale
lament jacinth
#

Should be able to loop through all light entities in the entity list. Try just running a simple PrintTable(ents.GetAll()) on a clean map and see if you see LIGHT or anything like that

#

@serene gale no idea why that didn't reply to your message but cool

#

If you see the entity

#

You just take it's position and go from there

#

If you need help with that code I can write it in my sleep so I can also do that when I'm home πŸ‘

#

lua_run PrintTable( ents.GetAll() ) and also try with lua_run_cl

serene gale
lament jacinth
#

But you may need to sv_allowcslua 1

lament jacinth
#
map gm_bigcity
sv_allowcslua 1
clear
lua_run PrintTable( ents.GetAll() )

Do those commands in console

#

Paste me the response in the Garry's mod channel lol

#

Then do

clear
lua_run_cl PrintTable( ents.GetAll() )

And same

sleek sparrow
#

Might need a BSP parser for the static lights if that's what you're looking for

lament jacinth
#

Yeah that's what I was going to suggest

#

I believe NikNaks has it

lament jacinth
lament jacinth
#

better reflection image

#

Though it's alittle too reflective

lament jacinth
hearty fox
#

Like

#

Wow

wooden bane
lament jacinth
#

Problem with water is that the shader controls it completely, and if there's no shaders there's no water. If you take the shader out and instead use one of the standard valve ones that have fallbacks, the material renders. Once it renders you can use remixes remastering tools to render the water

#

Since those textures can also be animated, there's more I can do with it. For now I just used it flat.

#

And that's what I did, you can see in the above the water works again. I just need to modulate the color to fit the exact water that is in the video for each material

#

I've already selected the right materials for it

#

This was the plan with a lot of other textures that don't work because they are 100% dynamic shaders

#

With no fallback

wooden bane
lament jacinth
#

Thank you boss

#

I'll be testing that out later

#

Pasting here for my own record:

You adjust the transmittance color color3f inputs:transmittance_color = (0.3, 0.65, 0.86) (..) and transmittance distance float inputs:transmittance_measurement_distance = 800 (..)

You achieve the water becomes blue-ish as it gets deeper by adjusting its transmittance measurement distance

I think this as a whole means more or less the material color will become inputs:transmittance_color after the light travel distance reaches the inputs:transmittance_measurement_distance 
#

Is there some place where this is all recorded?

lament jacinth
#

They are marked as terrain textures, using latest DXVK

old halo
#

that happens in basically all games i've used terrain textures in

#

i haven't been able to figure it out, and iirc NV_AJ said it's normal for now?

lament jacinth
#

Alright

#

Just gotta make sure

#

So I guess I should go back to using decal

#

Yeah alright decal works

old halo
#

did you disable bounding box? @lament jacinth

#

in the terrain settings

lament jacinth
#

Lemme try that

old halo
#

gotta re-mark it as terrain

fathom bolt
old halo
#

oh yes, it was Peter. it happens in Skyrim, Barnyard, and Morrowind as well

lament jacinth
fathom bolt
#

I think there's probably just a one frame offset or delay somewhere in the terrain baker causing that, but I'm not actually familiar with the guts of that system, so I could easily be wrong

old halo
lament jacinth
#

damn

old halo
#

i thought i opened an issue about this, but i could be mistaken

(yeah, i didn't. my bad)

lament jacinth
#

Is this fixable through a remastered asset or is this entirely within that baker Mark?

#

well from your best guess

fathom bolt
#

within the system, I doubt it has anything to do with assets

lament jacinth
#

Back to decal I go then!

fathom bolt
#

It's happened in enough different games that if it does wind up being an asset problem, then it's something we need to check for and tell users how to fix. Mostly likely it's just something in the timing or something.

old halo
#

would you like one of us to open a github issue about this for tracking?

lament jacinth
#

-snip-

fathom bolt
#

there's already an internal ticket for fixing it, so a github issue won't make much difference in this case.

lament jacinth
# lament jacinth -snip-

Snipped my shit because GIGA BRAIN over here (me) accidentally made the diffuse the metalness in the replacement!

lament jacinth
#

Alright new issue. I am using the auto skybox detection and I think the map's skybox is too close to the main area or something? Whenever I render the skybox it no longer renders the map

lament jacinth
#

I HAVE REMOVED THE BALLS.

old halo
lament jacinth
#

trippy

lament jacinth
#

Anything with blue-ish hues on it are still using the DX7 lighting

#

I've only seen this when I mark things as world textures

#

this stuff up here

#

You can also see it here on the gates of stonehelm

#

Actually even worse, there is water there

#

this is the actual skybox. the water is achieved by a USD mod

#

you can see the difference between the two immediately, definitely making me think it's simply NOT treating what's there with the same scrutiny or treating it with the same flag as a ui / worldspace ui

wooden bane
lament jacinth
#

The blue lines are just DX7 stuff in Dark Messiah

#

the internal software lighting stuff is ass

#

It is specific to DM so no worries

wooden bane
lament jacinth
#

Yeah

#

It is definitely just the skybox cam not being treated the same as the regular one, because it doesn't even load the enhanced textures

wooden bane
#

Here's the conversation we had, might give you an idea possibly you can provide more useful info to NV : )
#1116089843479498782 message

#

#1116089843479498782 message
Here is the one for the terrain issue, Xenthio has an explanation

mild zenith
lament jacinth
#

I'm gonna test that out today! Thank you

lament jacinth
lament jacinth
lament jacinth
#

Not the biggest update but @hearty fox is doing an art pass and I swear remix is some wizard shit that it can just add heightmaps like this and it works. LATE I know but STILL gotta give props

old halo
#

ooh, that's very nice

sleek sparrow
#

hot

lament jacinth
#

More remasters by @hearty fox

#

SLowly but surely working through them by hand

hearty fox
#

There is definitely more work to be done

#

I'm still getting my feet wet with Substance designer, since I've only used it sparingly before but I think the results are promising

sonic thicket
steel heath
#

Took a crack at the guard yesterday. Render it out and oof. Better today lol
A couple rendering errors. Need to reimport him in a pose where he doesn't overlap.

lament jacinth
steel heath
#

I'm not sure. I hoped it'd be a matter of throwing the textures into the AI sampler, masking off areas for height/roughness/metal fills and wrangling the colors levels back into parity with the original but it crushed so many details I just ended up having to paint them back in.

I think it's a much smoother approach on terrain and bricks and such.

#

I need to check out some more models and get an idea for what brushes and stencils need to be made.
I'm not sure a full repaint would even be much harder with that done.
And certainly that mail, sampled from the originals is not holding up anywhere near as well as the stock substance material would.

steel heath
#

For a start there's 4 different rivets and grommmets on this armor and a leather stitch that all desperately need to be in my normal brush library for general use lol

maiden mauve
lament jacinth
#

Those specific textures not yet

#

but you can get the RTX Mod!

#

That reminds me, I need to get that standalone on ModDB now that we can πŸ™‚

#

which thank god because version controlling that on my storage.. hah

lament jacinth
#

The newest bridge works with dark messiah HUZZAH!

lament jacinth
broken needle
#

fingers crossed

neat haven
#

JUST started using RTX Remix, and the first game I wanted to mess around with was this game. Noticing these weird depth pass issues on the newest version of RTX Remix. Any recommendations?

lament jacinth
#

This is an unfortunate problem with the way RTX is handling the skybox

lament jacinth
wooden bane
#

probably all source games have

lament jacinth
#

Yeah it's the way the camera and skybox is analyzed

#

If I knew a little about it on the RTX side, like what the camera analysis does, I can try to fudge some maps around and see what works within dark messiah

#

Also I'm not really doing updates here since I've been hard at work but currently working with @hearty fox with a bunch of stuff

wooden bane
#

Is 3d sky a workaround for map size limitations? If not why not just align all the sky geometry with the map and let the main camera render all?

lament jacinth
lament jacinth
#

In VTMB it allows you to have skyscrapers that really feel gigantic

#

In this game you have a large city or vast ocean

#

It would be impossible to scale some of the skyboxes to the real size and then just render it normally without bloating the map

wooden bane
#

But they are currently rasterized in remix.

neat haven
#

Beyond that I haven't found any fixes

wooden bane
#

Did you spoof the shader model to 0 ?

neat haven
#

I would not be too sure how to do that, never worked with this tool before sadly

#

That screenshot of mine above is probably my first 10 minutes using this RTX Remix stuff haha

lament jacinth
#

Skybox aside you are running with my DX7 patch right?

neat haven
wooden bane
#

#1098843924602306601 message

lament jacinth
#

Yeah follow the stuff there, I need to push out the update to ModDB

#

I fixed water and a bunch of other particles

#

and a few remasters in there

wooden bane
#

Kinda offtopic, but how the coop mod is going

neat haven
#

patch worked, thanks. now i gotta just figure out what to tag as terrain and decals and whatnot, I am noticing tagging certain assets as terrain stretches the UV's quite a bit? Should I be tagging these environment assets as something else?

lament jacinth
lament jacinth
#

Also, make sure you download the latest RTX and DXVK files

#

my DX7 patch is unchanged but that is the latest rendering stuff

#

like off the git

neat haven
lament jacinth
#

regular decal

#

then leav the area and rteturn

#

so the texture can reset basically

neat haven
lament jacinth
#

should

neat haven
#

hell yeah, looking a lot better

#

im having some trouble finding that thing where you can click on an object in the game to find it's texture, any idea where to enable it? sorry for so many pings @lament jacinth

lament jacinth
#

If you click on ehancements

#

or well

#

the texture selector tab

#

i forget the name

#

once you do that you can hover your mouse over stuff

neat haven
#

nice! got this whole area up and running with all materials properly set up

#

im getting about 20fps on my 2080ti though haha, definitely has room for improvement on my part

lament jacinth
#

Yeah make sure you tweak the DLSS settings

#

!

lament jacinth
#

no luck

lament jacinth
viscid oriole
#

have you tried using the "depth flags" 3d sky detection option too? an NVIDIA engineer recently suggested we use that option and it solved another skybox-related bug for us

lament jacinth
#

Yeah both options unfortunately don't work

viscid oriole
#

ack

#

in that case no, but if we run into it in HL2RTX I'll let you know

lament jacinth
#

Thanks, hopefully you never experience it hah

lament jacinth
#

Here's some pics courtesy of @hearty fox assets, don't mind the rainbow windows we were doing some spectrum testing πŸ™‚

lament jacinth
#

Oh we're cooking with fucking GAS now boys

#

Got the depth fixed

#

this was indeed an issue on DXVK

#

i might still have to do a source patch to resolve the skybox rendering when you're not on the skybox cam (a consequence of the noculling stuff)

#

but other than that, just need to fix the textures not being replaced

lament jacinth
#

but the actual skybox looks fine

#

though again, missing the RTX passthrough

#

I know exactly how to solve this so I just gotta put the hours to do it

#

will post an update later today

lament jacinth
#

alright so that one is fixed

#

slightly incorrect about the culling, it was due to the way I was forcing novis

lament jacinth
#

@fathom bolt if you had a sec to guide me, where in the DXVK repo would I find the code for assets getting replaced?

#

If you look above I managed to solve the skybox depth issue

#

but the assets are not getting fully replaced or have any light passing to them

lament jacinth
# lament jacinth

Here you can still see the blue which indicates is my DX7 textures not the new replacements

lament jacinth
lament jacinth
#

I can fix it myself just need a map πŸ˜›

lament jacinth
#

I THINK I found the logic in SceneManager::submitDrawState

#

Yeah okay

#

this is the guy

#

Going to have to play with this

fathom bolt
lament jacinth
#

Yep was already tinkering

#

HOpefully will have a nice screenshot in a few moments..

lament jacinth
#

@fathom bolt If I'm understanding correctly the scenemanager basically assembles all the stuff into a surfaceMaterial which is then ACTUALLY applied to the instance manager's "Process Scene Object" function. The scene.trackTexture calls are for the loading and caching(?) of the new texture and giving it a reference index

#

So then out of curiosity what is the distinction with that whole process and the context.bindResourceView shortcut that the skybox is taking?

#

I understand that the bindResourceView within the skybox function is targeting a specific index within the skybox textures

#

But it's not something I ever really see done elsewhere

#

Just want to make sure I focus my effort on the "right" way of implementing it

fathom bolt
#

I'd have to spend a bunch of time digging into the various functions to try to understand that - I'm not terribly familiar with it.

I do expect that all of the textures the scenemanager is tracking also need to be bound down into Vulkan at some point, but I'm not sure how that works.

lament jacinth
#

Ah okay

#

To explain the problem in simple terms, at least as I've understood it, the skybox texture is set to only change the albedo coloring because it's programmed to expect anything in the skybox camera to be just the 6 faces

#

In the source engine, the 3d skybox includes the mesh surrounding it, which are only getting albedo color updates

#

so I want to process all this stuff through the scene manager instead of this one path

fathom bolt
#

I know we added some logic to make the 3d skybox work better in HL2 - I think instead of treating those things as sky, we just do something to detect the skybox transform and move them into the normal rendering space (as normal objects)

#

or maybe I'm misremembering, the docs on skyBoxGeometries imply they're still rendered differently... are you using that?

#

Am I correct in thinking that you're trying to apply PBR replacements to stuff that's getting marked as sky, but the sky geometry rendering is only allowing for albedo colors?

lament jacinth
#

I don't think I've ever even tagged anything as skyBoxGeometries yet.. let me try that out and get back to you

lament jacinth
#

It's getting marked as sky only because it's in the sky camera

#

Well not LITERALLY getting marked as sky but being processed AS sky

fathom bolt
lament jacinth
#

Yeah nah that just changes the color format

      if (TextureUtils::isLDR(m_skyRtColorFormat) && (!replacementMaterial || replacemenIsLDR)) {
        ONCE(Logger::warn("Sky may not appear correct: sky intermediate format has been forced to HDR "
                          "while the original sky is LDR and no HDR sky replacement has been found!"));
      }

      m_skyRtColorFormat = m_skyColorFormat = VK_FORMAT_B10G11R11_UFLOAT_PACK32;
    }```
#

that effects the render target view output and just generally brightens everything rendered within

#

Or at least that's what it feels like in Dark Messiah hah

fathom bolt
#

Intuitively it feels like we could add some mechanism to just render those 3d sky geometries at a very large scale instead of baking them into the skybox, but I'm not familiar with the specifics of the system

lament jacinth
# lament jacinth

To be honest the solution you guys have DOES work so far. This is after I've fixed the depth issue that I reported some time before in this discussion

#

It would be nice if there was just a function that does the bindings and such alone

#

and then you just call that

#

Unless the light and tracing is not taking effect in the skybox or in the outputted sky matte RT, but I havent' gotten far enough to validate that yet

lament jacinth
fathom bolt
#

If you do actually need a feature change here, make sure to file a github issue about it so it can be tracked / prioritized.

lament jacinth
#

Of course

#

@fathom bolt unfortunately it seems the mesh hash is too unstable for me to use it reliably, any idea if there's a way to live reload it from the remix toolkit?

#

so I can add it to the config and just refresh

#

Actually, the MODEL ones work fine

#

but it still doesn't solve the issue unfortunately

#

the depth issue also continues to happen so at least my fix will be worthwhile to push upstream to you guys

fathom bolt
lament jacinth
#

The rtx config file, similar to how you can reload the USD files by doing a mod.usda edit -> save

#

I don't think it matters because some of the hashes were stable and it was still not rendering with the correct overwrite

lament jacinth
#

It ended up being better than trying to get the stuff to process into the RT

#

There's this little jitter I have to fix and I'm not 100% sure what's going on, right now I am apply the difference between the sky and main camera

#

Skybox seamlessly transitioning between world

#

You can see the issue here

#

the floor sorta slides

#

but the props keep still

lament jacinth
#

Oh I see, I need to cache the offset

lament jacinth
lament jacinth
#

Alright, last issue is that I need to preserve the render order of the instances when I translate them

lament jacinth
#

that way I can fix it on the source engine

#

It's almost as if it renders the world THEN the sky somehow right now

#

really odd

#

And by that I mean it does the MAIN CAM -> SKY CAM

#

If there's any ideas I'm all ears

#

Will throw some more time at it later

lament jacinth
#

I saw the preserve draw call stuff in the d3d9 files, is that the right place?

#

@fathom bolt

fathom bolt
lament jacinth
# fathom bolt the right place for what? Not really clear what you're trying to do

Apologies, basically I want to know if at any point RTX is changing the draw call order. Digging through some of the D3D9Device / D3D9Rtx functions, I saw something like const auto [preserveOriginalDraw, pendingCommit] = m_rtx.PrepareDrawGeometryForRT which are conditionally passing the data through to a draw prepare or committing it

#

In that very function example D3D9DeviceEx::DrawPrimitive I do see that it can immediately draw it through the context too

#

I'm at work still, so I didn't get to tinker with that portion yet, but that's where I was headed

fathom bolt
# lament jacinth In that very function example `D3D9DeviceEx::DrawPrimitive` I do see that it can...

I don't believe we ever change the order of draw calls - each draw call is either passed into the raster pipeline, captured into the scene_manager as a ray traceable object, or handled specially (i.e. sky or terrain). My understanding is that the memory used by the original draw call's buffers isn't safe to reference after that draw call returns (since the app may re-use it for the next draw call), so we can't just store the entire original draw call for processing later.

lament jacinth
#

I see, so within that function passing it immediately would only happen for objects that don't receive raytracing, and storing it is used for assisting the lighting later

#

I'll mess around with how the depth is applied then because that's probably where I can solve this

fathom bolt
#

hmm, what do you mean by storing it?

lament jacinth
#

Re-reading what you said I realize I misread it at first, I thought you said you can't reference but you CAN store it which made me think you were making copies of the data just for light analysis

fathom bolt
#

not really - we translate the incoming buffers into the buffers we need to pass into the raytracing. we don't store the original buffers

lament jacinth
#

Yeah that's on me and post 11 hour work shift 😦

#

So then in cases here

      // Preserve the draw call data, which are needed for skybox pass later. But we don't need to actually dispatch the drawcall here.
      PrepareDraw(PrimitiveType);
    }```
#

I see the prepare draw is basically assembling all the stuff

#

I assume now this is passed to the scene manager for the actual draw

#

At which it will distinguish this is a sky potentially and add it to the sky matte / probe RTs

fathom bolt
#

I'm not too familiar with that code, but that sounds about right

lament jacinth
#

Alright, I'll head home and put some more hours on this

#

Thanks for the guidance!

fathom bolt
#

Good luck!

lament jacinth
#

Alright I'm back with another question if you know it, what RT does the SceneManager's submitDrawState go to? Is each RT based on the camera detected or is it the DrawCallID?

#

For example I created a new set of RTs with bindRenderTargets(newRT) and a new viewport setViewports(1, &viewport, &scissor)

#

and then I were to call getResourceManager().submitDrawState

#

It seems like it writes to a different RT than what I sent

#

especially because I'm doing depth manipulation so it's not using the original depth

#

@fathom bolt shameless ping

fathom bolt
# lament jacinth <@617500777191047168> shameless ping

SubmitDrawState is part of the code that translates from an input raster DrawCallState to a BlasEntry and an Instance. It doesn't actually draw anything - it just adds geometry to the virtual scene that will be path traced later.

render target and whatnot don't matter at that point

lament jacinth
#

Okay THAT'S good intel

fathom bolt
#

Remix doesn't currently support path tracing on multiple render targets - so all we do is rasterize to bake some calls into a texture, and then put that texture into the path tracing scene (for terrain, and maybe for sky? not sure)

lament jacinth
#

Okay that makes a lot of sense, that's why the skymatte is not ray traced at all, since it's doing all the work on the main RT

#

and that's why my only solution to adding that ray tracing was to move the sky geometry from the skybox into a scaled-real-world instance

fathom bolt
#

you can't think of a path traced scene as being a series of layers the way a rasterized scene is

#

instead, it's better to think of it as a virtual scene that we cast a bunch of rays into. Then the UI gets layered on top.

lament jacinth
#

Got it

#

So maybe to get your opinion since your last suggestion had some great results, here's the last issue

#

By moving the geo into the main camera it exists IN the main view

#

So for example

#

you can see the skybox walls here

#

And likewise here is the skybox's water leaking into the scene

#

What I wanted to do is basically overwrite the depth view from the skybox with the main cam

fathom bolt
#

that's a raster technique

#

remember that we also need to be able to see the sky outside of the main camera, for stuff like reflections

lament jacinth
#

It feels like it's still capturing that since the scale is so large. I didn't touch the actual 6 faces of the skybox just the actual geo within the 3D Sky. If you check the water there we are still seeing the right reflections

#

The point I've been interested in is messing with m_state.om.renderTargets.depth

fathom bolt
#

yeah... I don't think the depth of the render targets is going to do anything at all to the path tracing

lament jacinth
#

but obviously without the path tracing, it looks wrong

fathom bolt
#

the rays will go through the virtual scene. If they don't hit anything, they just sample a color from the skybox. if they hit geo, that's what they show

lament jacinth
#

I see

fathom bolt
#

so you can't really just say "the skybox geo is always further away than the scene geo". One way to get a similar effect is to massively scale it up, but they won't be pixel perfect with how it works in the source engine's 3d skybox.

lament jacinth
# lament jacinth alright getting better

The problem with massively scaling it up is that it's only the case for some conditions. In the first map here the skybox entity has a configurable scale set to 1, whereas that second one actually has it set to 4

#

I think default source has it at a x16 mul

#

it seems like there's gonna be some compromise on my part

fathom bolt
#

probably. You're trying to replace some of that sky geometry, right?

#

or just apply a PBR material to it?

lament jacinth
#

Just apply PBR, ideally I'd love for it to be traced as well beacuse of all the water scenes

#

but that's not possible yet

fathom bolt
#

Well... if you can get the geometry, you could always just drop that all in as a replacement anchored to the actual scene and just ignore the originals, then move stuff around as you like

lament jacinth
#

I'll see if I can do some fun stuff on the source engine side to resolve this

#

Thanks again for the insight

fathom bolt
#

Some of the other source engine games have had a lot of success with just dropping a unique anchor mesh in each level, then attaching a bunch of Remix replacements to that anchor mesh

#

if you're able to edit the map files, it's an easy way to just put whatever you want wherever you want it

lament jacinth
#

Can easily do that, right now I am trying to challenge myself in making a solution for the other source games that may not have that

#

most of the stuff other source games have to do is patch bytes so something like that may still be possible

sleek sparrow
#

I'd fault Arkane a bit here as well and say they placed some of the 3D skyboxes way too close to the playable areas

lament jacinth
#

It's a partial problem, maybe had to do with consoles?

#

But I think i ACTUALLY have a solution to the above problem

#

I need to test if this works

#

and then I have to strategize how to make it agnostic

#

we'll see

#

fingers crossed

lament jacinth
#

Hah okay

#

I have no idea how I'm going to basically automate the discovery of this

#

but the skybox scaled views scale down the player position, causing my offset positions to be all wonked out

#

and ending up with the skybox physically in an incorrect location

#

hence the leakage

#

the movement is actually perfectly okay because the meshes NEVER interact once the scale is correct

lament jacinth
#

No leaks

#

have not automated the scaling yet though

#

GOing to need to sleep on some method to detect that..

lament jacinth
lament jacinth
#

just gotta find a consistent way for scale detection, add a couple of config options to enable/disable this, and we're gold!

lament jacinth
#

@fathom bolt here we go again with potentially stupid questions, but each one has pushed me forward and it's the final stretch

#

In the skymatte we have those draw calls that are taking in the index / count data and just putting it into the RT

#

this is not a path traced view, so it just renders what I assume is the raw vert data and calls it a day

#

In the sky matte view, the scale and positioning is all completely correct for the skybox meshes minus the lack of path tracing

#

Now jump to the path tracing part

#

When I move what WOULD have been a skybox model into the main view

#

I get my path traced models

#

however I lost the scale and positioning

#

When I restore that information with a transform matrix, it works fine

#

So the question here is if the path tracing is digesting this information and deliberately removing the scaling somehow

lament jacinth
# lament jacinth

In this picture, this is the skymatte rendering the sky box models

lament jacinth
#

I'm assuming all digestion is still happening in

#

D3D9DeviceEx::DrawPrimitive

#

then it goes to CommitgeometrytoRt on the d3d9_rtx

#

at which it moves to context

#

finally pushing to instance

#

and then that info gets path traced

#

You said it doesn't do any actual drawing at the later stages, so it's all happening in DrawPrimitive

#

Just really confused how the matte is able to retain the scale at the very least and I have to manually check for that

fathom bolt
lament jacinth
#

Before it gets pushed to the RT IIRC, on the DrawModel of the source engine

#

That's why the skymatte RT, just processing the vert data, can work without any modification

fathom bolt
#

Is it running through a vertex shader, or still on the FFP?

lament jacinth
#

Should be no shaders

fathom bolt
#

well, I've not looked at the sky code generally, but the transform data is definitely accounted for in the path traced route. Maybe the sky route is just missing that, since sky geometry is usually just a sphere at 0,0,0.

There could also be problems related to whether the geo is anchored to the camera or the world?

#

if it's rendering to a separate render target, then the camera transform for the camera may be different? maybe we don't handle that correctly

lament jacinth
#

I'll look into that

#

The above images I sent are all straight through remix, just in different targets

fathom bolt
#

I know some sky would be anchored to world 0,0,0 and some would be anchored to the camera

lament jacinth
#

When I am applying the fixes

#

I am actually applying it to the objectToWorld mat which from what I've seen is always an identity

#

so it's possible I just gotta get that information back out

fathom bolt
#

I'm not following exactly what you mean, but it sounds like you know what you're talking about πŸ˜›

lament jacinth
lament jacinth
#

Amazing news, I have done it!

#

Got a formula for dynamically getting map scale and offset

#

My original algo from offset was improved to now include scale

#

and now everything is perfect

#

Should work on other source games as well

#

I need to clean up all the garbage code now and add the config options

#

Need to add configs for

Enable Skybox Shared Depth (Rasterized version, write to skymatte but without broken faces)
Enable 3D Skybox Meshes-to-World offset (Allows path tracing of skybox meshes)
Enable 3D Skybox Scale Fixer (Allows skyboxes that are not 1:1 to be scaled accordingly)
    - Dynamic / Static (for fixed scaling skyboxes it can be static based on an inputted value IE: 16 is a source classic)
    - Also rescale sky Offset (for source engine games in general due to the formula they use)
lament jacinth
#

@tardy heart and @placid hedge just so you see the thing about decals being a magic switch for displacements, here's my fav example from the E3 map in DM:

placid hedge
#

ahhh

#

interesting

#

also we might have just narrowed down the issue with the ui texture flickering

#

we are looking at it closer

tardy heart
#

very interesting

placid hedge
#

@lament jacinth the ui flickering was being caused by us marking textures as "Ignore Textures", changing it to "Hide Textures" fixed that UI flickering issue.
To me that seems like something probably worth reporting as a bug? It doesn't do that in the current live version of Remix.

lament jacinth
#

I think ignore will just prevent it from getting light whereas hide completely stops rendering maybe?

celest oriole
placid hedge
#

interesting the behavior changed in the new version, before it acted (at least visually) roughly the same, but now it causes all kinds of messed up UI issues

lament jacinth
#

@fathom bolt in a particular frame, would I be able to check if a model instance is rendered in two different views? The instance manager has that function to check if one already exists based on objecttoworld, otherwise it makes one, just want to double check that it will persist for that frame in both views if the object matrix is similar

#

Have an idea to improve the algo based on the VTMB testing that was done and I wanna know if that rabbit hole is worth digging

#

Just in time for easter

fathom bolt
lament jacinth
#

Spent all this time making a good algo to reverse the skyoffset and scale from the skyview and main cam

#

only for it to blow up in my face because of floating point precision errors

#

but I did manage to make a new one

#

and pending the VTMB team testing, should have a purely agnostic way to get these values from a single point instead of a delta point

lament jacinth
#

Excuse the UGLY coloring but I got color correction shaders to work by basically rewriting this in a fixed pipeline way

#

it's not.. amazing.. it's basically an overlay

#

the real brunt was getting custom shaders to work in dark messiah at all

#

but now that I DID

#

I can probably go through and get any of the non-fixed shaders into some fixed-pipeline form

#

The reason this is so important in dark messiah is because there's a few maps that use color correction to set the stage. Attack on stonehelm from my previous post for example is supposed to be red and firey, but it's clear. While that does look nice, the objective is to make it work properly

#

The cool thing about this implementation is that because it's basically an overlay, the pathtracing works on top of it

#

My end goal would be to link the shader directly in with the vertex color stuff in remix, which would fully emulate how it's done normally

lament jacinth
#

Took the time to make a little teaser!

tawny timber
wise oriole
meager stirrup
#

do animations still suffer above 60 fps with this remix?

lament jacinth
lament jacinth
wise oriole
#

Wdym source engine

lament jacinth
#

The game runs on the source engine

#

So I know how to navigate the source engine pipeline

wise oriole
#

Gotcha

#

Didn't know this ran on source

lament jacinth
#

Yep! A very very old version of it albeit, but source

mortal ruin
#

What happened to the skybox fixes, did they ever get finished?

lament jacinth
#

In the process of PR'ing it

#

the optiosn are all there

#

and it's functioning

mortal ruin
#

Awesome, thanks for the responding c:

lament jacinth
#

I cleaned up the push and sync'd everything up

#

@wise oriole is helping me fix the delta calibration, but this will likely just effect one if-statement as to when it's triggered

celest oriole
#

@lament jacinth I won't be around for a few more hours but I can guarantee I'll look at it before the weekend is up.

lament jacinth
#

No problem, and I appreciate it

#

BE VERY SCRUTINOUS when you do

#

Your delay gives me more time to figure out the delta stuff πŸ˜‰

lament jacinth
# lament jacinth also tested it

I should mention to anyone that tests this out, it goes to .trex, and it does not have the bindless fix in it because it's using the direct-from-repo changes for it to be PR ready. If you'd like the bindless thing pre-baked, use this one

celest oriole
#

I won't have access to a Remix capable computer tonight so I'll need to wait another day to test. Sorry for the delay. πŸ˜” @lament jacinth

lament jacinth
#

I thought you were gonna do a code review hah

celest oriole
#

@lament jacinth Sorry, misunderstood. I'm taking a look right now.

celest oriole
#

Preliminarily I'd say there's a lot of extra whitespaces and small formatting tweaks done that will potentially cause problems for the engineer trying to merge it, and those changes should be removed if possible. I did notice also that "Source Engine Based" in the engine has a typo.

#

As for whether "Source Engine Based" is the best description, I know that a lot of Remix thus far has been engine agnostic and more focused on behavior/description than engines by name-- it makes me think Hyperbolic might be the better word to use, though maybe you could include the mention of Source in the tooltip for this box.

lament jacinth
#

I am unaware if any other game uses this exact scaling technique

#

I put hyperbolic there just in case

#

but it seems a little too early to make that call

#

But if you feel that works better, I'm with it

#

The reasoning you gave is sound

lament jacinth
#

I think the editor itself got stupid and started adding them

#

I didn't even rtouch those areas so.. really unsure why

#

But I'll go through maybe with a different editor and try to get rid of them

#

Even when I did a diff compare it wasn't picking them up, but then the git was

#

really dumb

celest oriole
#

Yeah I had something similar happen, my first thought seeing what was affected was that it was probably automated

#

It may be worth just combing in with a "dumber" editor like Notepad++ if it helps get around those kinds of autocorrections.

lament jacinth
#

Yeah that's exactly what I was going to do

#

notepad++ never fails for me

#

I use VSCode

celest oriole
#

But yeah after reading some of your other tooltips it sounds like referring to Source directly is a good call.

#

Same, probably why I ended up causing the same problem throughout my commit 🀣

lament jacinth
celest oriole
#

Sky Settings might be a good place to put it though, now that it's no longer buried inside the texture catgory.

lament jacinth
#

aye aye

#

It amkes sense to me

#

makes*

#

How does the actual function implementations look? And the addition of the skyscale/offset params to the camera obj?

celest oriole
#

At a glance it looks good but I need to peek at the style guides and some other previous commits

#

I'm not sure if I remembered to send it but a few days ago I noticed a new contributing style guide appeared in the repo.

lament jacinth
#

Oh yes you did

#

I did peak at that

#

I at the very least followed the naming conventions

#

Question now regarding squashing, I'm going to make these changes you suggested and I assume just squash them back into the current commit

#

What about the commits that are pending from master, since it'll be out of sync atm

celest oriole
#

As long as it gets squashed into a single commit at the end of the process it should be okay. I know you synced up so it may be possible you'll have to rebase again.

lament jacinth
#

I'll see what I can do

#

Oh good news there haven't been any new merges NOW IS MY TIME

celest oriole
#

Lost internet connection for tonight. 😞 But what I've gone over looks good aside from what I mentioned.

lament jacinth
#

Well I made the changes and squashed. Could not find the typo

#

but that's set