#Bioshock (Original Release)
972 messages · Page 1 of 1 (latest)
It started working again after selecting this texture. It freezes again if I deselect it
As a UI texture
It’s working! Laggy but it is haha
how did you bypass the new game plane crash?
This looks like it’s just being rasterized. Try adding dxvk.hud = rtx to dxvk.conf
Do you mean the Rtx.conf?
I thought rasterization wouldn’t work if it was running with remix? Doesn’t it override rasterization functionality entirely?
And the plane crash wasn’t an issue for me
Try turning in debug from the rtx menu. It's on the first window
If it's path tracing it'll render it all red and stuff depending on your debug view mode
This looks rasterized though. Path tracing makes everything look crazy and weird until you set it up proper
Still tinkering with it to see if I can get it to ray trace, it seems to recover from freezes after disabling v sync in game though.
Could you quickly try turning on debug though?
Yeah it didn’t show anything
Do you know what these textures are for? They seem to have a particular effect of the freezing
Cheers
Is it for lighting?
Hmm how should that be categorized as? The game has its own global illumination system, so maybe messing with these will fix it
If debug isn't changing the render output it's rasterized. Check your log and search for a line like "can't find camera"
That's the final nail in the coffin for getting this to work with BioShock
In the root game folder, where you put the trex one you have two log files. It's one of them
Why wouldn’t it be able to find the camera?
Not sure. Just the message you get when it won't work. Had the same with cod4
yea i was curious why no crash now i have my answer
This is unacceptable lol there must be a way 😂 I’m gonna look through the modding community, there oughta be someone who modified the camera system in the past 2 decades lol
Rip
So disabling “capture vetices from shaders” made it freeze. I saw somewhere in the discord threads that this helps fix the vertice shader capture?
dont forget to add -dx9 to the command line on the bioshock shortcut so it does not launch the other version
Yea I’m farther than that
save game?
i crashed on the flight sequence
but this was remix 1.1 back then
i wonder
It's not about the camera system. It's something completely else
Remix isn't able to find the gamera data from the data that's moving between the CPU and GPU
No mod can fix it
I think the camera message may be from booting up the game since the vertex shaders option does have an effect. If it was rasterizing entirely, I don’t think the remix settings would freeze it up ? Maybe I’m wrong. I refuse to believe it won’t work lol
The bioshock config file is super configurable. I will find a way 😂
Hmm. It seems like the game keeps overwriting the config though
you need to change the original one
i tried to disable the lightmaps now the game wont run lol
What did you set it to?
tried erasing normal after 2 lightmap settings and it crashed
Anyone had any luck with this recently?
No, Remix still cant find valid camera
Darn, maybe down the line rtx remix will get updates to help get this rolling. It'd be beautiful with raytracing
@whole gull for the love of god, use snipping tool for screenshots (it's installed on all windows versins) and record gameplay with obs
Bioshock (Original Release)
anyone tried it in 0.4?
This game has so many folders, I forgot how I installed remix into this one 💀
I can doublecheck when I get home 
(To be clear,
is mostly right, it hooks and sees textures, but it doesn't render the game with raytracing enabled, but it plays sounds, my assumption is it is a little confused about the render target)
Yeah I had similar results with bioshock 2, I should've documented a quickstart guide when I had it running lol
Ok coolio:
I have a test save at the Bathysphere juuust before you enter Rapture proper. I recomend you make a test save before setting up Remix if you haven't already.
Put d3d9.dll and .trex/.. in ...\Bioshock\Builds\Release\ folder next to Bioshock.exe
Create a shortcut to Bioshock.exe (can be done on Windows via the right-click menu (or shift+right click menu on Windows 11)) and for the following target parameters:
- At least
-dx9to force DirectX9 and I also use-nointro(with one space separation) just to help get into the game a little faster for testing.
Settings are stored under C:\Users\{USERNAME}\AppData\Roaming\Bioshock\ (where {USERNAME} is your log in name)
I swear I had to do something to Bioshock.ini and if I remember what it was I'll edit it in here 😂
I recommend using the debugoptimised version of Remix so you get the toggle at the top of the Remix menu to enable or disable raytracing.
I also recommend opening the remix menu the instant after you click continue on the main menu. I've had issues opening it later if the load menu gets stuck.
One oddity is save games are actually stored under ../{USERNAME}/Documents/Bioshock/SaveGames/ and not in the Appdata directory
Thanks for the guide! Got it to hook again. It's rasterized for me, but the game renders normally. I found an old mod that apparently allowed graphics cards with 2.0 shader model support to play, https://www.moddb.com/games/bioshock/downloads/bioshock-shader-model-2-asankel-fix-mod
Was hoping it'd somehow get remix to render, but no dice.
I remember messing about with this as well, but frustratingly (at least for the time being) I can either get it to show a raster image, or "raytrace" but show no image at all.
I've been working on a bioshock compatibility mod on the side
apologies for the flat materials, working through a instancing problem
watbulb the goat strikes again 
its honestly a miracle this game even rendered in the first place properly. buffer overflows all the time when doing memcpy's into vertex buffers.
apitrace is like uhhh, are you sure this is right? (and of course crashes)
and yeah tons of shaders in this game, I could never make it fixed function. I've been mostly making the existing shaders compatible
mmm mm. love me some stable geometry
instancing fixed
this is what it looked like before. So bad the encoding compression cant even keep up:
uhh, epilepsy / seizure warning
Spaghetti code
it doesn't help that every instance in the world has floating precision issues too, like every object every frame moves by 0.000001 type stuff. terrible
Yikers
they also redraw the geometry 4 times
in some cases
most of it is for texture staging. they waste a lot of drawcalls on stuff, mostly a product of UE2.5 garbo optimizations
I'll start on the new thread soon, need to make a pretty thumbnail, I guess
I do not look forward to making water work properly in this game. maybe fog + running slang shaders on the remix side for el agua
Resting water could probably be done with texture replacement with key framed sprites (to inhibit/cause motion)
so spooky with volumetrics 😱
Yo that's insane
I thought there was no hope for bioshock in rtx
Please keep at it!!
I'll try!
Is this supposed to be black?
the video or the environment?
I haven't replaced or added any lights yet
nornally in game. no, there's several emissives, but it is a dark room
No the video is pitch black for me
oh weird, maybe an encoding thing? it loads on my phone
discord has been having alot of problems with video lately idk why, lots of weird paused videos an shit
I'll check it on PC later then
What in God's name... 
Works on my phone
Yeah I restarted discord and it worked
Discord on Android is straight garbage
Aye, it's true
Nooooo android discord has no issues idk what ur talking aboutttt
The video player bugs out every 3 bideos

Nvm as soon as I hit play it dies
What phone? I'm on a Zenfone 9 and it rarely breaks. The changes to UX are ass though
Samsung Galaxy A32
It's a budget phone
Is there any benefit to going with a budget phone over a used flagship
Warranty. Plus you will know for sure that everything is going to be in perfect condition.
Ypu can blame the origional owner when it mysteriously ends up in someone's cranium
@rapid cargo if you get it in a fairly stable state, lemme take a stab at one of the common env textures 👍
sure 👍
@shut lichen sorry for the random question, but do you know what the "attach light to texture" option does (when selecting texture category)? I figured maybe you might know.
I mean maybe it attaches a light to texture ... but kinda confusing figuring out how?
It's as you would expect. It attaches a dedicated white sphere light source to all instances of the texture marked
This is unique to the runtime, often times things you'll want to attach lights to like particles will have unstable mesh hashes so you can't do it in the Remix toolkit.
oh okay cool, im going to need to use that for now, since this game also rotates the world, and remix doesn't know how to handle that, so placing a light will not stay correctly until I do some more transform reverse engineering to bind a light to a object position.
thx for the info
may have gone a little crazy on this emissive 😛
add light to texture doesn't work when world transforms are used/always changing Q_Q. thankfully there's enough fixtures on the maps to do emissive and emissive masks. kinda sucks though. 
@honest badger is it in theory possible to port a material shader from omniverse, such as the perlin noise water shader, and add it as a custom .mdl and .usda "Look", which can then be applied to material or mesh instances?
I tried for a little bit and I think it might work? but im not sure. for reference this is my .mdl and .usda look (made some modifications to the .usda to conform it to remix):
the green reef material uses the perlinwave mdl. (there is an option for it to animate, but its optional)
cool that I can just distribute these according to nvidia copyright in the mdl file
if it is not possible to do it this way, can you think of any ways in-which I can run a shader on the remix side on a certain material or mesh? unfortunately not familiar with that aspect of the code
Using MDL to drive USD properties is easy - it's very much how Omniverse USD Composer is designed to operate, and we built the Remix Toolkit on top of all of those utilities.
The problem comes with the Remix renderer / runtime. Implementing the full scope of MDL is very expensive on the GPU. Remix's MDLs are primarily there as a way to define the parameters that our actual hand-written shader code uses.
Okay, thanks. I figured there was a little more to it, so I stopped before wasting a whole bunch of time. There's so many kinds of different ones in omniverse, but I noticed remix uses very few so I was wondering if there was more to the implementation.
So I'm guessing the native route is slangh shaders, is that what the live shader edit mode is for?
and where do those go?
@rapid cargo so umm, can you let me know how this works and what's the current status
current status: not ready
how it works: we ignore draw calls that are used by shaders which are deemed too complex to handle, and either recreate them or competely discard them. We only need geometry and normals / UV for the most part. plus some engine fiddling
also ignore samplers for specular and lightmaps, etc
stages, etc
Throwing all complex shaders in an on fire dumpster
yeah pretty much. the technique could actually work for many games, but its luck based. all it takes is one shader to ruin your day with some type of shit
this is the product of spending a couple weeks staring into the matrix of PIX until I figured out all the drawcalls that actually matter
so does that mean
- Remix runtime hooks
- Seeing Ray Tracing effects (in which case DxVK.hud would report BLAS as >0)
- Stable enough mesh hashes for mesh replacements etc.
yes
instancing fixed for the most part, see: #1144016019195691008 message
I need to fix some kind of specular highlighting geom bug, but for the most part its pretty stable, like 85%
alr bro, im lowkey interested in Bioshock, if it works well enough with just hooking remix etc do let me know. I'll update the compatibility listing
massive caveat: you cannot place lights using the runtime because remix does not know how to deal with non FF games which rotate the world and view. So you need to get dirty and creative with emissives and emissive masks until I dig more into the game logic and reverse the drawcall transforms
sure, I will make a new thread later today or tomorrow
I want to have this compatibility mod finished for atleast the first chapter or two by christmas, i'll probably put a build up somewhere in the next few days for beta testers. will take a week or two to cleanup code and stuff, plus im going away next week (for an open source release)
if you want the runtime light problem fixed yell at nvidia 🤷♂️
how does it look like when you take a capture and load it in the toolkit
hit and miss, not sure why. works better if baked transforms are captured. sometimes it captures everything, sometimes its a vertex explosion. in any case not a super big deal, just take three captures for every normal capture, and you should have captured almost everything in front of you
culling needs to be disabled for this game tho big time, so im working on that too. there is a CullDistance setting, but it doesn't affect the FOV of the cull frustum (or w/e they use), so if I can increase the frustum FOV there should be no odd culling anymore. Just setting the player camera FOV isn't enough
somewhat proper capture
almost every texture has baked lighting, but it can be trivially removed
dude needs to be replaced so bad
chunky af
I love how the hanging lights clip into the flag too. never noticed that, but I just double checked on Xbox360 and sure enough
🙃
Is a man not entitled to the sweat of his browww 
lol
HMU if / when you need more people on this.
Id love to contribute to Bioshock asset replacement; and if you ever have the time Id love to bend your ear a bit about reverse engineering and c buildchains (my Oblivion work is stalled on some linking issues).
I have been struggling (but part of that is self-inflicted) but of course no obligation what-so-ever ❤️ happy just to lend a hand with materials and meshes!
Hi 👋. Sorry I missed your message. Sure, I'll let you know when it stabilizes more, currently just working my way through the game and fixing as much as I can before letting people do that, or else it would be a waste of time as everything would need to be retagged. Or some idiot will post a video on youtube.
Everything seems to be going okay for the most part, minus a issue with LODs being forced to a lower level once the player moves through a different portal.
if you have any reverse engineering questions just ask them
@languid totem what software are you using for your PBR mods these days? I keep forgetting what there all is / people use. Also do you have any recommendations for materials repositories? Currently I just use NVIDIA's VMaterials 2, but I don't know if they are open source materials. They might be since they are essentially MDL examples. I need to generate some basic materials to mark replacement objects.
I could use the AI tools, but those don't work on 2xxx series
he uses community made AI models. PBRify I believe, which is an ethical model like Nvidia's attempting but with better quality results. There's a process that automates the PBR upscales + applies them so you could get placeholder PBR materials that largely fit the original designs
Okay. Yeah I’m sort of going through and looking at ComfyUI and things. I don’t see anything that says if there’s a minimum card requirement tho. I can’t run any of this stuff on a lower end card, right?
PBRify scales to lower end cards I'm pretty sure. @fickle moon ?
dunno when she'll come around, but she made PBRify
Do you have any recommendations for open source materials that already have been created?
Like say I want a marble.
freePBR, AmbientCG, PolyHaven are all options, each with their share of hits and misses but largely they work well
Thx for the suggestions
from ambientCG
depending on how "generic" the texture being replaced is, you can get some really high quality replacements through this stuff
Well that should probably be more than enough to work with
For now at least
That’s so cool they are all free and have different formats and resolutions
for sure. If you're curious I threw some free materials onto Black Ops 1 as a proof of concept here #1152352915781058580 message. I would just copy paste but the images are loading super slowly for whatever reason
it was a touch tricky to get decent matches but it worked for a test
the carpet in particular is a really sweet before and after
Wow yeah looks great. Trying to find suitable rock and brick materials for now, since I’m not capturing any normals or UV (until I fix many, many issues with intercepting them from the shaders.).
Most of what the character is looking at is rock, but with the current default albedo and weird SRGB texture it all has a flat sheen so it makes it a little difficult to test lighting characteristics. From my initial testing a scene becomes nominally brighter in most games with the simple addition of PBR textures due to the drastic change in surface light interaction.
in the black ops example it actually got quite a bit darker. It's really fascinating to see, shows we take modern PBR for granted I think
Yeah I suppose it would depend on the setting and the properties of the initial textures and surrounding ones
@shut lichen Since I see you use substance a lot (I’ve never used it). Would you say once you know how to you can create whatever surface you envision? Or is it still pretty tough? Do you use substance for that?
for tiling environment textures I use instaMAT, I started using Substance Painter for props specifically. instaMAT is similar to Substance Designer in that it uses a node graph to build textures procedurally. I'd say for the most part once you've learned the basics you can make a good 80% of what you'd wanna make at least
from there the hardest part isn't making the texture, rather making the texture realistic. So getting the roughness right on a certain material for instance. For that I try and get feedback from others to tune in the final stages. Also getting natural looking imperfections has more of a science to it relating to knowing how real world materials degrade. That's another thing I ask for help with
btw instaMAT is free so no harm in giving that a shot if you want. It comes stocked with a whole bunch of procedural textures that have different parameters you can customize so you aren't stuck with an exact texture like many open source assets will be
Ah okay. That’s another one I’ll have to read up on (InstaMAT). Thanks 🙏.
If you are trying to figure out what roughness or metalic amount is correct could you use the toolkit to checkout the values during render time? Or do you kinda need to go back and forth between software and toolkit (like A/B comparison testing)
I don't use the toolkit, I get it right in the texturing software then it transitions about as you'd expect in Remix, just with a much more realistic light response thanks to pathtracing
lemme see if I can't get a quick example
Ahhh that makes way more sense.
Good to know the material properties are faithful between render engines t
That would be such a pain in the ass if not
there are differences but generally they're not gonna be an issue unless you need hyper specific control over the look. Like with stylized stuff
- How it looks in Substance Painter
- Remix in a bright environment
- Remix in a dark environment
Oh wow. That’s quite spot on.
small disclaimer that the Painter representation is in 4K, the Remix examples are 1K so some precision is lost. Fine for such a small object
but yeah the texturing software has very flat lighting typically. You get a very neutral representation for the most part. Once you get it in action that's when you see all the differences in various light conditions
Still looks great!
Let’s say you wanted to make the red button emissive. Could you do that? How would you do that? Currently the only way I know how is to make a emissive mask as a negative of all the areas but the button (if that makes sense)
the red button is emissive lol (tho not super strong). Substance painter exports emissive maps that Remix accepts just fine
Oh shit no way
I do all that manually right now 😂😂
actually I think that image is messed up, circle should be not janky like that. But it works in-game so 
Common Auto W 
Yee I use PBRFusion the most currently, https://huggingface.co/NightRaven109/PBRFusion but if you have a 20's series card I'd use PBRify, it's quality is just as good and is less stressful to run, https://discord.com/channels/1028444667789967381/1216200397497045002
Ah okay good to know, thanks. I was wondering which one worked better on what cards
And for already made textures I mainly use https://ambientcg.com/ and https://polyhaven.com/ 
@honest badger I desperately need a way to selectively disable alpha blending for specific textures. Do you know if this is possible through the runtime? Really unsure what's going on, looking at pix it doesn't seem like its doing anything unexpected. A few things really need the blending. So the easiest way I can see forward is to ignore the operation on draw calls that use alpha blending when the bugged material is set for that call. But what do you think? Attached video shows the disappearing bug.
stupid discord, apparently the video is paused 🙄
hopefully that worked
I think there's an ignore alpha tag for textures. It was added a month or two back to the runtime
hmm yeah, the problem is I need to explicitly disable the blending step, not alpha in general
I thought that would have worked as a short term fix too, but apparently not for these stairs
🤷♂️
Can be done in the first tab of the runtime
I think under a section just called alpha blending
what makes it even weirder, is if I override the drawcall to force:
if (State == D3DRS_ALPHABLENDENABLE) {
Value = FALSE;
}
it still happens, so it might be a remix bug.
yes I know, thats what I set in the video
but that does it for everything
oops. On a slow connection atm so couldn't check the vid
np. I could probably solve this on my end by hashing all the texture pointers, then disabling the op when detected. but if its a useful feature to have in the runtime I'd rather just do a PR for the feature. similar to ignore texture alpha
but even that might not work if the above override I tried doesn't seem to work as expected (in the code). I need to read up more on alpha blending
yup
works perfectly now even on very low end cards
you could use it on a 1060 most likely
oh nice 👍
"-very low end cards"
1060
that hurt 😢
well, the fact that there's a 1060 3 GB... 😛
but yeah, sorry lol
with changing of the tile size in chaiNNer it can run on even lower end cards though
also, skurtyy uses pbrfusion now instead of PBRify i think
I'm not sure I understand why ignoring the alpha channel for a bugged texture doesn't do what you need?
I mean I don't know either. if you set ignore alpha it doesn't do anything 🤷♂️
on that texture
okay, so setting the texture to the ignore alpha categories doesn't seem to do anything for you?
and the behavior is that when alpha blending is enabled, several parts of the mesh just disappear?
Have you tried disabling OMMs?
that's right.
the category right about what you were clicking - opacity micromap ignore texture - please try that
okay will do
(not confident, just eliminating possibilities
tho as a note, with material replacement it's possible to change the alpha blend settings, which could probably fix this too
same thing unfortunately
I think I'll probably have to do that.
oops meant to reply to message below
I'll just have to make alot of captures
oh, its not obvious from the video I just shared, but the geometry is still invisible when I disable alpha blending, because I need to move my camera for it to redraw it
(I dont know why)
It should be a material replacement, not a mesh replacement. I presume you intend to replace all the materials already 😛
That being said, I'm not actually sure this is even a material property... the way things appear / disappear as you move around means there's probably something else going on...
Does this game use light maps or anything like that? I see some normal maps in the texture list...
you may need to ignore those draw calls for the normal draws to work correctly
it only happens in that area, which is a portal area between two parts of the level. I already ignore all lightmap and specular draw calls
better on/off comparison
with it off, its just culling really and some slight hitches
some noise stuff cuz I was on performance and no neecache
Your videos are so dark I can hardly make out what's actually going on in them 😦
The fact that different parts of the staircase seem to be missing at different times makes me think that this has more to do with draw call order or something like that, and less to do with the actual alpha blending
you sure about that? looking at it on my iphone it looks fine ...
I can record it again, but I am trying to show you the staircase does not go missing with blending disabled
its very clear
as in multiple draw calls get routed to the same mesh, and depending on the order of those calls we either draw using the stair material, or some detail / dust / whatever mateiral
I mean I can break out the entire call trace for the mesh from pix if it helps debug, its nothing crazy
well, the fact the rendering doesn't instantly change when you disable that is also suspicious
does the same geometry get re-used with a different texture / shader later on?
I think so, there's multiples of those staircases in the level I believe
possibly with different textures
I mean multiple times in the same location
some games might draw the same mesh+transform multiple times. the later draws would be mostly transparent, just adding a layer of grunge or dust on top of the original
sometimes they do that with crazy alpha / color blend settings
possibly, that was one of the things I had to stop, the game draws geometry without textures bound to it multiple times (which are visually useless 99% of the time)
I can check for the staircase geom specifically
just based on the behavior I was seeing, it seemed like something along those lines was more likely
are both draws using the same texture?
I think so ... but like you said its doing some whaacky alpha color blending stuff on the second call
which comes after
so that makes sense 🙃
then yeah, just ignore that second texture 🙂
it doesn't show up tho in remix
, only in PIX 👀
Does the texture show up in the texture list on the right? it may not be selectable in the viewport
You can make the remix window wider and I think you can make the thumbnails smaller
or you can just take a capture, pop that open in a non-remix usd viewer, and you should be able to select that mesh and see what material hash it uses. Then manually add that to the rtx.conf
@honest badger huh, setting it to world space UI background instantly fixed it
I'll take it
I actually feel really stupid now for not just trying that
the primary texture, or the secondary? you should be able to just ignore the secondary...
the primary one
not sure if it will still get correct lighting if you set the primary to world space UI, but if it works 🤷♂️
good to know
thanks for the rubber ducking 🤝
welp, I ended up implementing a full blown material hashing system anyways :P. I couldn't figure out how to disable alpha blending on certain things from just the toolkit captures, especially since captures are currently quite flakey. I also couldn't disable it on the skysphere texture.
was probably a useful excercise anyways since it uncovered some bugs where the engine seems to be re-creating the same texture multiple times per frame when moving through certain areas, while using the same handle (may not be a bug persay, but its a perf hog)
[MAGOS] WARN: collision detected on texture ptr: 299B0C10
[MAGOS] WARN: tex hash: 112148190
[MAGOS] WARN: collision detected on texture ptr: 299B0890
[MAGOS] WARN: tex hash: 3774354147
[MAGOS] WARN: collision detected on texture ptr: 299B13F0
[MAGOS] WARN: tex hash: 3900075402
[MAGOS] WARN: collision detected on texture ptr: 299B14D0
[MAGOS] WARN: tex hash: 927481549
[MAGOS] WARN: collision detected on texture ptr: 299B1690
[MAGOS] WARN: tex hash: 4097111396
[MAGOS] WARN: collision detected on texture ptr: 299B1770
[MAGOS] WARN: tex hash: 315185263
[MAGOS] WARN: collision detected on texture ptr: 299B1D90
[MAGOS] WARN: tex hash: 3534146792
[MAGOS] WARN: collision detected on texture ptr: 299B2030
[MAGOS] WARN: tex hash: 4234063710
[MAGOS] Current texturePointerCache size: 60
[MAGOS] Current texturePointerCache size: 85
[MAGOS] Current texturePointerCache size: 91
[MAGOS] Current texturePointerCache size: 91
[MAGOS] Current texturePointerCache size: 91
@shut lichen how tf you get unreal engine 2?
this is 2.5 and that would be useful ...
I thought it was UE3? AFAIK all UE2 games shipped with a level editor, Republic Commando included. So I'm using what's already in the files
its right on the edge. its 2.5 officially, but since UE3 was coming out soon they ported some features over
idk I guess its UE 2.75 😛
Lol that might make it trickier then
it had an editor, they never shipped it
I wonder if there are modding tools made that achieve something similar?
not that I know of. bioshock is probably one of the least modded games ever
the original one atleast
there's some weird stuff floating around to port the game assets to source 2 engine tho
there's two mods: https://www.moddb.com/games/bioshock/mods
Q_Q
I love how it says "RTX Remix compatible"
wat
Moddb's remix compatibility list is not good
it needed a massive rework and it never happened 😦
Awww, they had visions of modded bioshock
An editor would’ve been so cool back then
This tool allows you to install texture packs and game patches created with UPK Explorer for UE2-UE3
@shut lichen you use these at all? or does your editor extract all that?
I use umodel for exports
o word
That might be better though? Umodel can be a pain to navigate
yeah umodel can be a little crusty. I'll give it a shot. Thinking it would be way easier to en-masse determine all the alpha blended textures from the files and replace them directly instead of taking the runtime penalty to do it
although I might be assuming there is a penalty, but it's probably not free
also, this software is clinically insane for this type of stuff: https://www.watto.org/game_extractor.html
looks like shit but its god level software
10 bucks
so you use it then? if so, would you say it's a worthy addition to some of the tutorials in #1095534398134300682?
I do use it yes. I’d say so. I can’t think of anything else that is as comprehensive. It does cost money, but it’s not an egregious amount
I think the free version at least supports reading the file format. So the user could do that in the free version to see if it works before purchasing
@shut lichen screenshot example. Seems pretty powerful 👀

man, you can just do trivial texture pack replacement and everything. just select a group of textures. replace them. easy

UPK explorer my beloved
made all the geometry 4x scale 😳
configurable alpha blending / testing without capturing
need to disable the game's input 😛
is that overlay remix related? If you create a bridge.conf you can configure the mouse/key input to not go through to the game. Some games it doesn't out of the box but that setting has helped me personally
huh? nah the overlay is entirely custom (its rendered on the game side). If I turn on the option to disable input to the game I lose the ability to use my menu
I need to override it myself, just have been to lazy to
mostly because it involves me finding the option to disable its dinput8 stuff, since they dont use window events or any basic windows API I know of to get the mouse position. and I have no idea how DirectInput actually works
somewhere in the game I could set a bit and it would all go away, kinda hard without sauce tho atm
using TV static to test denoiser performance 😅
that feeling when you forget to click save in the runtime and actually click "recompile shaders" instead of "take screenshot" and waste an hour of progress 🙃
working on medical pavilion now. chapter 2. after this chapter I will release a beta so people can start replacing stuff. I haven't replaced a single thing yet, this is all done in-engine. (I am making sure things will work correctly so when people do replace things it works as expected)
amazing work
IF ONLY WE HAD ReSTIR FG FOR CAUSTICS
Ikr 😞. I’ll probably end up implementing a custom water shader for this game. It looks so bad right now. And I have no idea how to solve it using anything available in toolkit since remix doesn’t support water materials. I could fake it for now though maybe with glass.
Somehow skurty got a water like material here though, which I might have to try for now. It’s the best remix water example I’ve ever seen. Not sure how it works (it uses some valve vmt material)
#general-remix message
afaik the game uses an animated map for the texture, and you can just replace those in Remix and assign the water texture tag
for a shader based water system yeah you're kinda screwed 😦
Remix does have "real" water but it's not even remotely for this purpose. It's for flat planes of water like lakes
What I mean is remix has no water .MDL file
Nor toolkit
So it’s not real
All they have is transparency or translucent
well real in that it's an effect that's reuseable under given conditions
Xoxor had it in Call of Duty 4
Well whatever it is I’m not following because remix has absolutely zero water material
So idk honestly
I could be misremembering the details
@sour gulch wanna share what your puddles of water in CoD4 were
I remember a clip where you dipped the barrel of your gun under the water and it refracted
Well it’s kinda half and half here. There is dynamic water volume bodies. But they never interact with the player and are only used on the outside of glass windows. So that can be solved by fog a bit. The few times the player swims in the ocean, it already simulates that well with fog, but I need to create an event system to detect when in the body of water.
For the shader water “streams” at least on lower quality it uses a map of them like you say and scrolls them. I can’t get rid of the alpha on them from remix but if it was done from toolkit it could work a little bit. But that’s just the dynamic splashes of water. Still need a resting style water (pools)
That’d be neat
It might have something to do with source engine
well that's why I mentioned him getting it in CoD4
it's so far removed from source that I doubt it's reliant on a specific thing that's only in Valve games/GMOD
Sorry i replaced cod with portal in my brain
remix is designed around source pretty much, so a ton of stuff is reliant on it
for example anti culling. it's often very very broken in non source games
True. But if he got it working in COD I’d be interested.
Yeah I wish the anti culling worked better
what's more likely imo is xor patched it to be compatible with remix's implementation of it, which is focused on source
As long as it’s implemented as a type of material at the end of the day I could probably redo it. But if it’s done dynamically through the engine and it’s generating the new water every frame I’m in trouble 😅
oh yeah it 100% was made for use in Source games since that's what Nvidia has remastered, I just believe it can be reused doing some trickery
actually @honest badger probably knows too. How to set up water in Remix
yeah it definitely can be if you're patching the game anyway
he'll roll on by tomorrow most likely
My ultimate solution I had talked with him about before was reimplementing the nvidia perlin noise water material as a slang shader which runs on the path tracing side. Then remix will handle it natively. But I didn’t hear much from him on that. And it’s pretty complicated. Thankfully they wrote more documentation for the shaders than the actual runtime (not trying to be rude, genuinely useful stuff)
Doesn’t half life 2 have water? Maybe I could ask David or something as well what they are doing.
ya
Uh I simply set the water surface to translucent. No trickery behind it 😜
Hmm, could work but would be hard. Resting water texture changes every frame from a column list, then it will emplace water drops on it dynamically
I’ll give it a shot
Well. I guess I can detect all the flat water textures and disable their updates and leave it on the first column, then remove the droplet UV displacement
that would look insane
I’m gonna try what Jason did with gmod, and place a large flat piece of glass above the room, project a strong light through it, and hopefully the rays will reach through to the floor
If that works possibly a fake caustic pattern can be projected through the glass (or emplaced by a pattern on the glass which shifts)
I’d imagine this would be very expensive so it’d be toggleable
works alright, reflection is total ass though
btw if you need more performance, try turning off RTXDI
ok
seems to work somewhat better, get about 10-15 fps more when on performance DLSS
turning it off doesn't really seem to do much visually. I'll stick to the "simpler" sampling method for now
yeah it's a very minor difference, enough that i'd be happy with it being off by default tbh
I mean its supposed to be a superior sampling method. confused on how it can have its own name and everything yet visually perform the same as the legacy sampling method
seems like a lot of time and effort for ... well I dont know what
maybe there's a debug view I can checkout to see the difference better
huh?
we have nowhere near that level of difference with rtxdi off / vs on
its possible im just being a huge jerk and the legacy method is actually some variation of RTXDI (less cycles or something)(. or that DI doesn't really have a big impact in remix as with other games. just playing devils advocate
or. or. this is the impact without DLSS
which isn't clear from any of the marketting docs
it most likely is some other step negating the benefits
either way, it doesn't seem worthwhile 90% of the time
also disabling NEE cache can sometimes provide a small performance boost
Yeah I disable that too sometimes. But it’s basically a requirement at this point in this game for emissives
With it off the emissive never bounces
Which kinda sucks but I’m glad the cache fixes it
ya i usually have it on too. in Barnyard since all lighting is emissive, it's 100% necessary lol
it was such a huge improvement when it was first added
Yeah I couldn’t imagine it without it. I’d have basically no lighting lol
I also turn up it’s training speed to the max
Helps smooth out the emissive bounce when moving the camera since it can reflect the change faster, I think
what GPU do you have?
in my experience just lowering dlss is the easiest bet. After setting bounces to 2 and using ray reconstruction
Only a 2080 😢. Waiting for 5th gen and will immediately buy a 5090
he's already at DLSS balanced 😦
so things like this help without making it look like mush
Yeah I always run on perf or balanced. Can’t really do ultra when working on proj since it doesn’t render as faithful as I want and sometimes I gaslight myself
ya
replacing DLSS with 3.8.x to have preset E would help a lot with visual clarity too
I keep meaning to do that. Tomorrow I will give all the presets a try. I’ve been really missing out on that aspect. I didn’t even know you could do those things
The new Ray reconstruct dll is good tho. Fixes sparkling issue I was having before
Well you need external tricks to do it. Except if you use the 3.8.10 dll, it'll force preset E which is the best overall and a noticeable improvement for Remix in my experience
Oh ok good to know
Oh btw, a really easy software for switching DLSS versions is called DLSS Swapper. Let's you download any dll version straight from the program and it's one click to replace in a library of games on the main page
And it works with Remix games. So for me Republic Commando shows up in the list despite that absolutely not being a game that had DLSS lol
Oh neat I’ll def check that out. Thx
Right now tho I can average between 30 and sometimes up to 80 inside rooms with a 2080. So I’m guessing that’ll go to something like 100-200 with a 5090. I literally can’t wait.
Perf DLSS of course
after you release the demo version of this, i can do a comparison on a 4090 for you to have a more accurate guesstimate
i get 100+ FPS in a well optimized scene on a 4090 at ultrawide 1440p with DLSS balanced btw. that's with little to no legacy alpha/transparency in the scene
(without frame gen)
Sure that’d be great. I’ve been trying my best to optimize for performance, especially with having a low end card. My mod has extremely minimal overhead even tho it processes every draw call in some way. Probably less than 2% per frame.
Mostly I’ve been trying hard to remove as much alpha as possible from everything since most textures have an unused alpha blend component which sucks huge frame time resources that effectively do nothing. Without alpha blending the performance in some areas is two fold increase. The only other bad perf problem so far is an intermittent vertex explosion that happens during certain draw calls that use a shader remix doesn’t understand for the vertex positions and causes a single frame lockup. But the overhead of that frame is about 10 whole standard frames. (I’ll eventually fix this by hashing out the bad shader during the call)
It becomes much less noticeable if you just have a good card
You can get the hash for fog volumes and use underwater materials on them now. I messed around with it in cod2 but I don't have any underwater sections to really show it off
Oh wait yeah that's gotta come in handy for BioShock in some scenes
did recompile shaders cause a crash or something? It should just take a minute (or a few minutes) and then the game should keep running as normal
I think it was my fault. It consumed all my cards memory
So it didn’t crash per se. just 1fps
When you hit recompile shaders it also opens a new cmd window which switches the current window focus. That causes the renderer to pause in this game, which would then pretty much pause remix. So I’m 99% sure this is not a remix problem (just a jank problem)
regarding water - I've seen people get nice looking water in several titles. The water textures category just leads to a small bit of code in opaque_surface_material_interaction.slangh that takes a second sample from the normal map with a modified texture xform, which itself is animated based on rtx.opaqueMaterial.layeredWaterNormalMotion
Okay cool. This might sound stupid but bear with me. The water (pooled water) currently only displays as a normal texture. So I need to somehow bind that water normal texture to an actual material underneath, right?
the game is sending a texture to a draw call, but the (shader?) bound to that call treats it as a normal map?
Yeah 😦
you should be able to just specify a regular material replacement for that draw call
the primary texture gets hashed, regardless of how the game used it
Okay. Then that’s what I was doing here #1144016019195691008 message
The blue is just a replaced normal texture
But this is cool and all, and I can probably optimize this
But what I was hoping for was something like #1116089843479498782 message
what material settings were you using for the replacement material? and did you explicitely override the alpha blend settings? or just uncheck 'use legacy alpha blend' or whatever that's called
I think the source engine animates the texture transform of the regular normal map, which is what lets our animated water trick work
I have to go back and get the exact details. But it was just glass basically, not thin walled. And with transmittance. I didn’t disable alpha blending
I didn’t try actually
Yeah that’s what I figured
I guess I could … animate it myself
Since I can already detect the hash of a texture for every draw call, maybe I can detect it, then transform the normal to like scroll across the surface
I finally also added xx hash64 for 32bit so now I have hash parity with remix
that's actually a feature I've been wanting to implement, and probably reasonable for you to just add to remix yourself - specify a texture transform speed for u and v in the Remix material.
Mmm that sounds straightforward actually. It would be a good exercise as well to familiarize with that level. I could then make a custom category for that
Or just re use water
Or say water scroll
no need for a custom category
you're just adding a transform to the existing textureTransform based on a material property, so there's no new shader code for it
in instanceManager, when it does this:
currentInstance.surface.textureTransform = drawCall.getTransformData().textureTransform;
You just want to get an extra transform from material and multiply that by the frame time so something like
currentInstance.surface.textureTransform = drawCall.getTransformData().textureTransform * (material.getAnimatedTextureTransform() * SceneManager.getGameTimeSinceStartMS() / 1000.f);
I don't think SceneManager is available inside of instanceManager, so you may need to pass down the timeSinceStartMS somehow.
Ah okay got it! Just wanted to make sure we were talking about the same thing
in material_data.h you can just add properties for something like 'vec2 uvScrollSpeed`, and then in RtSurfaceMaterial or MaterialData convert that scroll speed into a transform matrix
Thanks for pointing out the existing timers. Or i probably would have done something stupid with std::chrono 😌
I think there's already a github issue for scrolling textures. Yet another feature I want to implement but haven't had time for.
gameTimeSinceStartMS is in milliseconds, and is the same thing we use for animating spritesheets. Which doesn't perfectly match the actual game time - we'd need some way to detect pause and slow-mo, which we haven't bothered doing yet.
Well so long as it scales with the frame time it should be good enough for now. Once i get the basics done could probably implement a pause detection and coefficient to adjust the scroll speed
I guess an easy way would be to dilate the steps and just scale it by something like (k > n), and only increment k after n cycles
@honest badger can I get the frame time from reflex in any simple way? Is there a timer for that?
I don't know why you would want that? the GameTimeSinceStartMS is just the number of milliseconds since Remix started running.
the game pausing or going slow mo won't change anything about the frame times Reflex works with
Sorry I haven’t looked at the code yet, I’m at work. I figured it would jitter if the frame time changes.
It's the same timing that Portal RTX uses to spin the rim of the portal. Do you see that jittering?
(For frame times when animating in general, it's usually better to use milliseconds as an int instead of a float, to avoid problems with floating point rounding error over time.)
I’ve never played it. But no
ah, well I'd recommend just using it as is, and only spending time digging deeper if you actually notice jittering
and if you feel like implementing pause detection (texture category for the pause menu maybe)? then I'd recommend just making that pause detection effect the GameTimeSinceStartMS, since then it will be used by everything Remix animates.
Hmm yeah, I guess you would need a pause menu category since you can’t really disambiguate UI textures like that
Yep. Also some way of detecting bullet time sequences, tho I don't know if Bioshock has any of those
That being said - it's not exactly a game breaking issue if the water keeps moving when the game is paused
security bots work now:
pretty happy with that overhead (3.75%)
Does bioshock use similar renderer to thief deadly shadows? (thief 3)
I don't know. I've never looked at Thief
I doubt it though, this is unreal engine 2.5 and its bastardized with a bunch of custom crap
I guess Thief does use UE2, so idk, I'd have to look. Maybe I will in the new year
@valid quest I see Thief does a bunch of alpha blending shit which is expected for UE. I had to write some code which is basically a small copy of remix's material/texture hashing framework to handle bypassing alpha blended stuff because remix doesn't support per hash alpha blending adjustments outside of the replacement runtime
you can probably fix that game alot by messing with alpha blending and testing, but unless captures work its kinda a pain to capture everything and manually mark things as not alpha blended. And disabling all alpha blend is a no-go since UI elements use it
cooking up more debugging features
yeah its messed up
did you start off with precision issues and many meshes in the same place? strugglin with this with thief3. also seems like something wrong with the mesh normals, its strange
Sort of. This game incorrectly decides to draw a bunch of geometry untextured, then repeats drawing that same geometry in the same frame with textures. This causes remix to get very confused as it interleaves between untextured and textured
So I had to detect all the untextured draw calls and basically fix them up or ignore them entirely for the second pass with the textures
Then this game uses an index or stage order to bind certain textures. 0 diffuse / 1 normal / 2 lightmap / 3 specular, etc. you can think of it like a calling convention. I’d disable those texture stages that are problematic for now and let only diffuse through
PIX should be able to help with that a lot. Rig up single frame captures and start tearing apart the passes and how’s it texturing, doing blending, etc
And yeah I suffer from bad precision issues on the object transforms. This is excacerbated by ray reconstruction and causes significant transform jitter when enabled for whatever reason. As soon as RR is disabled VP jitter reduces significantly. Right now I take the lower half of the WVP floats and round their precision to the 4th decimal
I’m guessing that since i sit in front of the bridge calls I can visualize the jitter in realtime, it doesn’t happen without the bridge so there are floating issues around there that don’t have much to do with the game. It’s a remix thing. If I visualize the object WVP with and without remix there is no jitter
You might want to enable d3d9.invariantPosition in dxvk.conf. Or test it with vanilla dxvk
”Declares vertex positions as invariant in order to solve
potential Z-fighting issues at a small performance cost.”
Damnnn i came in here to look at cool lights not readddd
(This is a joke please don't kill me)
Thanks heaps man for the information, really helps a lot! legend
so weird. getting driver crash when reading vertex constant from shader ??
assert(SUCCEEDED(m_pIDirect3DDevice9->GetVertexShaderConstantF(binding.StartRegister, &lightVector[0][0], binding.Vec4fCount)));
just randomly fails at times, deconstructs and then m_pIDirect3DDevice9 turns into nullptr ??
threads be damned
just randomly started happening too, haven't touched this part of the code in a week
what the fuck:
somehow the whole D3D9Device object goes out of scope or the thread gets destroyed?
maybe I should just remove the deleter, idk
Oh … indeed the thread does die …. 
I think I've had enough computer for today. re-installing driver and rebooting PC fixed it

whale
office
@honest badger if you have any thoughts about this, would be appreciated. So on the tangent of world transform shader stuff. I spent some time looking at the scene manager again, and came across convertLight and what it calls (SceneManager::createEffectLight).
This seems like a logical place right? We have some instance, which has a material hash or mesh hash we know about, we pass this hash and the instance to createEffectLight to attempt to bind the light to the instance geometry. In a naive sense you'd expect to be able to do this if the scene manager has a copy of the game's scene, so it should know the positions of the instances based on the geometry data. This fails though in this game when it looks at the buffer data here, for every single instance in the game: https://github.com/NVIDIAGameWorks/dxvk-remix/blob/368525a7eedea156203502583f8860a3d05d955e/src/dxvk/rtx_render/rtx_scene_manager.cpp#L627
This confuses me, because I don't understand why it can't access this data here ...
I guess there is no position buffer 🤷♂️
Vertex buffers can exist on the HOST (cpu) and DEVICE (gpu). It's slower for them to exist on both, so generally they're only going to exist on the gpu (and thus be inaccessible from the cpu).
You can change the flags in the place where the buffer is created to make that data available on the cpu and gpu, but that's generally only good for debugging.
We do, however, calculate a bounding box for that vertex data, which should be available around there...
ohhhh, I see
input.getGeometryData().boundingBox.getTransformedCentroid(transform) where transform is referenceCamera->getViewToWorld(false) * drawCall.getTransformData().objectToView
that wil get you the point that is the center of the bounding box of the mesh, transformed into world space
the code I copied is from InstanceManager::processSceneObject and InstanceManager::findSimilarInstance
oh okay. So if I don't want to make the buffer host visible, I can basically bypass the point cloud centroid calculation and just take the mesh bounding box?
yep. we calculate the bounding box at the same time as we calculate the hash, but that all happens on a separate thread.
do you think that createEffectLight could be optimized generally to do that instead? Or is there a good reason do to the centroid calculation that way?
that way as in how its currently done
I suspect createEffectLight predates that, and was just never updated after we had it
I dont know why I assumed that remix marked the buffers as host visible by default, I guess I suspected it had to in-order to make it work.
I think it's host visible when it comes from the game, but we have to copy buffers a few time, and we need to release the CPU copy of that buffer back to the game before sceneManager actually processes that draw call
right makes sense, so host visible while copy, then release and copy to GPU
(basically, the game sends in a d3d9 call with cpu visible buffers, we process that, then return so the game thread can continue. But we want to keep that time minimal, so we basically just copy stuff off and then run sceneManager in a separate thread)
I haven't actually looked at that stuff in a while, but it's entirely possible we have logic to keep a cpu copy of the data around for some draw calls and not others
either way, the bounding box should be available for all draw calls
cool. in either case I can directly control the buffer visibility through my hooks. so either case I should be able to debug this kind of stuff now that I understand better
@honest badger it appears to be ... working. but not visibly ... in the debugger the transformed positions look good
. but remix is showing no lights rendered
is there something Im missing about:
m_lightManager.addLight(rtLight, input, RtLightAntiCullingType::MeshReplacement);
hmm maybe I need to change that
have you tried turning on the light debugging view?
in the rendering tab under lighting, there's a way to make lights show up, show their hashes, and show all their properties on mouse hover
and the rtLight you're adding is a sphereLight?
yep, looks like it:
RtLight rtLight(RtSphereLight(lightPosition, lightRadiance, lightRadius, shaping));
rtLight.isDynamic = true;
m_lightManager.addLight(rtLight, input, RtLightAntiCullingType::MeshReplacement);
Well, if you're set up for breakpoints, you should just step through addLight and make sure it's not early outing on some condition
there are a few places it can
yep, all setup
then yeah, just drop a breakpoint and step through it, see what happens to your sphere light
ahhhh, its failing literally at the top ??
const Vector3 originalRadiance = rtLight.getRadiance();
if (originalRadiance.x < 0 || originalRadiance.y < 0 || originalRadiance.z < 0
|| (originalRadiance.x <= 0 && originalRadiance.y <= 0 && originalRadiance.z <= 0))
return;
so, the brightness is 0
im just using the code from createEffectLight so it might be out of date?
or do I need to enable the plasmaball. hmmm
lemme see
it's grabbing the diffuse color from your draw call. if that color is black, all of those values will be 0
or if your radianceFactor is 0... you can jump up a couple of levels in your call stack and check what those values are
thats a little weird, because I bypassed the code and set it to call createEffectLight for every instance in the scene
so all the colors are black?
It's just getting this:
const D3DCOLORVALUE originalColor = input.getMaterialData().getLegacyMaterial().Diffuse;
It's possible that defaults to black and the game simply doesn't use it, since it's shader based
ahh okay. ill check whats goin on
easy hack to test, just hard code the radiance to lightRadiance = Vector3(1.f, 0.f, 0.f) * radianceFactor;
and all of your lights should show up as green
yep thats why, the material is just black. fixing the code to not call it on every instance so as to not blind myself and test further
IT WORKS!
this game has a problem where I can't actually see the hashes for some reason in the debug view
but it does work
well, it sort of works. but the positions never update for my selected mesh. doing this for worldPos:
const auto transform = getCamera().getViewToWorld(/* freecam = */ false) * input.getTransformData().objectToView;
const Vector3 geometryBoundingBoxWorldCentroid = geometryData.boundingBox.getTransformedCentroid(transform);
const Vector3 worldPos { geometryBoundingBoxWorldCentroid };
but atleast its able to get some distinct position from the instance hash ... some sort of progress
@honest badger is there a difference between referenceCamera and getCamera()?
okay im going to record a clip to show this better
the vehicle is the instance target. the position is about ~ (100, 60, 45) constantly, but under the debug camera it stays where it should ... am I using the wrong camera transform ... how's that possible?
it'll always show in front since the camera from the game always reports 0,0,0 if we never use SetTransform, as expected
Check out what we do in src\dxvk\rtx_render\rtx_instance_manager.cpp line 406
there's a whole case for trying to get the objectToWorld matrix when it's not set normally
the code I copy/pasted was from there
you may need the entire set of logic in that area to get a useable objectToWorld
okay, will do, thanks
@honest badger I made the positionBuffer host visible just to try that way as well. 💀
could this have something to do with users reporting that dxvk works well with this game if they use "invariantPosition"?
have you seen what the light visualization is supposed to look like when it's actually working?
first I've heard of invariantPosition
this looks like you're just reading random data
I thought maybe it might be because the position index is randomly changing or something
its the only thing I can think of, but yeah looks like random data
are the bounding box and transform matrices stable when the camera is still?
to make it visible I do a:
DxvkBufferSlice allocVertexCaptureBuffer(DxvkDevice* pDevice, const VkDeviceSize size) {
DxvkBufferCreateInfo info;
info.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT;
- info.access = VK_ACCESS_TRANSFER_READ_BIT;
+ info.access = VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_HOST_READ_BIT;
info.stages = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT;
info.size = size;
- return DxvkBufferSlice(pDevice->createBuffer(info, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, DxvkMemoryStats::Category::AppBuffer));
+ return DxvkBufferSlice(pDevice->createBuffer(info, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, DxvkMemoryStats::Category::AppBuffer));
}
seems correct?
and how do they change when you turn the camera or move around?
I believe that's right (for making the buffer visible)
Tho do keep in mind that the vertex data may be interleaved - reading it correctly is more than just starting at the positionIndex
yeah when I do it the bounding box way its stable, completely, but wrong position transformed (obviously)
does the bounding box change when the camera moves?
I don't think so because it always resolves to the same position using the bounding box way no matter which position the camera is
oh, are you looking at the actual bounding box values, or the centroid returned by getTransformedCentroid?
by resolved value I mean:
const auto transform = getCamera().getViewToWorld(false) * input.getTransformData().objectToView;
const Vector3 geometryBoundingBoxWorldCentroid = geometryData.boundingBox.getTransformedCentroid(transform);
const Vector3 worldPos { geometryBoundingBoxWorldCentroid };
so worldPos is always the same. I need to double check just the bounding box.
So yes, the centroid
yeah, the centroid is basically the bounding box, transformed by that transform matrix. So if the centroid is constant as the camera moves, either those two are both constant, or somehow they're cancelling eachother out
ill check the bounding box
I guess this isValid check does happen in getTransformedCentroid, not sure if relevant:
Vector3 getTransformedCentroid(const Matrix4& transform) const {
if (isValid()) {
return (transform * Vector4(getCentroid(), 1.0f)).xyz();
} else {
return transform[3].xyz();
}
}
hmm, I guess that just checks it for crazy bounds
just confirmed that the bounding box is always the same no matter what the camera angle:
minPos = {data=0x0000006c63dfdbd0 {-23.7952003, -0.173500001, -112.141403} x=-23.7952003 y=-0.173500001 ...}
maxPos = {data=0x0000006c63dfdbdc {45.2941017, 237.994293, 121.907204} x=45.2941017 y=237.994293 ...}
but unfortunatately the camera transform is never updating, so the lightPosition is always the same:
0 degrees dead on looking and 45 degrees to the left:
lightPosition = {data=0x0000006c63dfdbc0 {10.7494507, 118.910400, 4.88290024} x=10.7494507 y=118.910400 ...}
lightPosition = {data=0x0000006c63dfdbc0 {10.7494507, 118.910400, 4.88290024} x=10.7494507 y=118.910400 ...}
lightPosition = {data=0x0000006c63dfdbc0 {10.7494507, 118.910400, 4.88290024} x=10.7494507 y=118.910400 ...}
Well, at least you know what's going wrong.
You might see if any of the other transforms in the DrawCall are usefully updating with the camera movement.
I thought the bounding box was being calculated after the vertex shader is run... if it's actually calculated beforehand, then that might explain some other bugs that have come up
Okay I’ll look around
@honest badger I’m really curious to dig into some of the position interleaving stuff here as well. I whipped up a quick script that double checks that dcl_position is always at register v0 (or very few times o9?). Hopefully if I can figure out its interleaving. maybe I could go back to the old but gold way, at least to debug. But yeah, the stride is definitely not 4 here … hmmm
Oddly there are two vertex shaders that call for position decl twice …
Technically the fourth row in a WVP is the position, but I’d need another transform to scale it back
If you look at how we deal with the vertex buffers in other spots, you can get an idea of what's going on. But basically, we want all of the vertex's data (position, normal, color, etc) to be in one spot. so instead of Pos1, Pos2, Pos3, Color1, Color2, Color3 it's Pos1, Color1, Pos2 Color2, Pos3, Color3
it looks like yall have some tools in geometry_utils.cpp to deal with interleaving? void RtxGeometryUtils::interleaveGeometry (rtx_geometry_utils.cpp) ?
it might be good to hack away around there I think. it looks like its assuming some stuff, but its a nice shell to start with
check out src\d3d9\d3d9_rtx_geometry.cpp, particularly computeAxisAlignedBoundingBox.
You could probably add code there to also compute the centroid for the RasterGeometry, and store that with the bounding box
unfortunately, that still may be the pre-vertex shader vertices....
RasterGeometry is the data from the original draw call. RaytraceGeometry is the interleaved data
oh I see, I guess im not clear on that aspect yet. so you're saying certain points in the pipeline the transforms haven't been applied to the positions so they (quite obviously) aren't changing?
like through the shader
oh, is that why geoData.futureBoundingBox is a future 😅 ?
yeah.
I don't know this flow very well, but you can start from d3d9_device.cpp's DrawPrimitive function and follow it from there. PrepareDrawGeometryForRT is what schedules the geometry work to be done, then D3D9Rtx::CommitGeometryToRT schedules the CS thread to actually process the results. That all blocks the the game's render thread.
in RtxContext::commitGeometryToRT we wait for the futures to be ready, then actually handle the output.
The vertex shader handling happens in the PrepareDrawGeometryForRT call, but I don't actually know if the AABB calculation waits for the vertex shader capture to be done. the vertex shader capture is in D3D9Rtx::prepareVertexCapture
🤔
// NOTE: May be better to move reverse transformation to end of frame, because this won't work if there hasnt been a FF draw this frame to scrape the matrix from...
const Matrix4& ObjectToProjection = m_activeDrawCallState.transformData.viewToProjection * m_activeDrawCallState.transformData.worldToView * m_activeDrawCallState.transformData.objectToWorld;
is there any mods available for Bioshock right now or has nobody gotten that far yet
bioshock is way too shader heavy to just work out of the box with remix. I'm writing a wrapper for the game's rendering engine to fix things up to make it work, then the mods will come after. It's going to be awhile yet
alright
@honest badger I think I understand now ... I need to get the post-transformed state from programmablePipeline (prevCB.programmablePipeline) ? which will have some of the required post-shader transforms like viewToProj, worldToView, etc
i.e D3D9RtxVertexCaptureData modified = prevCB.programmablePipeline;
yeah, something like that
hmm okay, so I should check teh call state once all the pending futures are finalized
yep... though keep in mind that means the data is going from cpu to gpu, running the vertex shader, then has to go back to the cpu to let you run your code
hmm, but this will possibly be a needed expense for now, I can probably limit it by the lightConverter hash or something to that effect for the time being.
Eventually I would imagine you want the AABB to work on the post transformed stuff too?
yeah, maybe only doing it for select meshes. and yeah, it'd be better to have the AABB be post-transform, but making every draw call wait on a round trip to the GPU would be really slow
for sure. maybe I'll tinker with some ideas
@honest badger oh well look at this:
bool DrawCallState::finalizePendingFutures(const RtCamera* pLastCamera) {
ScopedCpuProfileZone();
// Geometry hashes are vital, and cannot be disabled, so its important we get valid data (hence the return type)
const bool valid = finalizeGeometryHashes();
if (valid) {
// Bounding boxes (if enabled) will be finalized here, default is FLT_MAX bounds
finalizeGeometryBoundingBox();
we are finalizing the bounding box and setting it to that post finalize:
geometryData.boundingBox = geometryData.futureBoundingBox.get();
so I will double check that createEffectLight is moved forward to ensure the finalization is run first before referencing the boundingbox
we're definitely hashing the pre-shader vertices though.
mmm, you're right. I need to spend more time looking at the order of operations here. Because as I see it DrawPrimitive->CommitGeometryToRT->commitGeometryToRT->submitDrawState->processDrawCallState->createEffectLight
and finalizePendingFutures happens during commitGeometryToRT
maybe the object picking might be worth looking at too? since it should have some info by that point?
object picking is done by drawing a unique color to a texture depending on the primary object the ray hits, then checking the pixel the mouse is over
think I found a way to get the position from a BlasEntry in the accelmanager after processing the instance. if this sounds stupid let me know 😛
ahhh I understand now, exec barriers are passed into the accelmanager to track the original buffer resources to queue on when the device is finished the submission
i'd love to see your tooling and workflow sometime watbulb 😄
If you have any specific questions just let me know. My workflow tbh is IDA, visual studio, debugger and pix.
aghhhh, I can't access the modified geometry position buffer even after making it host accessible 😱
for (uint32_t surfaceIndex = 0; surfaceIndex < m_reorderedSurfaces.size(); surfaceIndex++)
{
RtInstance& surface = *m_reorderedSurfaces[surfaceIndex];
const AccelManager::SurfaceInfo &info = m_lastSurfaceInfoList[surface.surface.surfaceMaterialIndex];
if (surface.buildGeometries.size() == 0) {
continue;
}
if (!lookupHash(RtxOptions::lightConverter(), surface.getMaterialDataHash())) {
continue;
}
AxisAlignedBoundingBox AABB = computeRaytraceAxisAlignedBoundingBox(surface.getBlas()->modifiedGeometryData);
tbh I barely know what im doing, but learning about how the accel manager works is cool
@honest badger yo Mark! I did it! kind of .... stays on the selected surface now
I need to do more thinking to figure out the weird interleaving since its replacing the geometry data before I expect it to
the viewmodel stuff seems to use a compute shader to get the positions or something to that effect from the modified blas geometry data
well... painful to look at ,but I guess that's an improvement
haha yeah
you're diving into code I haven't looked at in a long time, and never really understood well. but I'm happy to see you're making progress
thanks, I don't understand it very well either 😅
lots of dxvk and vulkan black magic happening here
yep
maybe I should try this in another title to make sure its not the game doing something strange
My man hit you with the. "I'm happy for u bro"
I think I found the reason, I wasn't expecting the scene manager to dispatch the accelmanager to call buildBlas multiple times in one frame. so I end up reading the wrong position eventually. Only one of these is correct between frames:
End Frame
124.579 127.126 127.126
112.436 126.5 -280.199
127.5 127.5 127.5
-734.166 -5281.66 1460.16
-734.378 -5901.72 1429.91
74.0035 -4014.58 1445.23
-648.582 1132.85 -573.642
63.5 63.5 127.5
End Frame
probably some threading stuff I dont understand yet
Are you saying it calls mergeInstancesIntoBlas multiple times?
Just as FYI - BLAS stands for "Bottom Level Acceleration Structure", and is basically a mesh asset. Those are all combined into a TLAS or "Top Level Acceleration Structure", of which we have 2 (one for particles and decals, one for everything else)
AFAIK mergeInstancesIntoBlas and buidBlases should only be called once per frame, though I suppose it depends on where you're printing End Frame from
I think so, I'll try to explain better my approach.
it's pretty bad since I'm reading the geometry data from the BLAS's saved input drawCallstate. It's still a little confusing figuring out when certain things happen, but for sure I shouldn't be reading the drawCallState's geometryData once it's been processed by the GPU (As the comment in the code says).
I stopped trying to create the light from mergeInstancesIntoBlas after the execbarrier and instead am using the SceneManager's onSceneObjectUpdated hook, and SceneManager EndFrame to track when (I think) the frame is over
SceneManager::EndFrame should be the right place for that. I'd recommend using SceneManager::processDrawCallState instead of onSceneObjectUpdated - processDrawCallState always gets called, but onSceneObjectUpdated is conditional.
makes sense. but for performance reasons, what I did is cached a copy of all the RtLights bound to all the seen lightConverter hashes in a array, then if the scene object updates its position I update the light bound to the surface object instance, otherwise it just uses the cached light. Do you think that makes sense to only update if the geometry positions change?
or am I wrong in assuming that the positions might not be a conditional update for the scene object?
well, it might actually be bad, you're right, since the update only occurs if it was cached
if (m_drawCallCache.get(drawCallState, &pBlas) == DrawCallCache::CacheState::kExisted) {
result = onSceneObjectUpdated(ctx, drawCallState, pBlas);
I dont actually know what that means yet
I should just use processDrawCallState and worry about that later. ideally I only want to update the light if the position changes, but I think the lightmanager has a low overhead for redundant light calls anyways because it hashes them and checks similiarity
or I just lookup the cached light and checks its position, if its the same bail out early
im able to make it work so long as I dont move my player
Just Mark it as a dynamic light and send it new every frame
yeah im doing that right now
ill post a more detailed explanation of my exact process a little later
I'm gonna be phone only and super busy for the next few days. Are you basically just attaching a light to a mesh based on the mesh hash? I assume doing it with replacements doesn't work, but could you just set up an option to handle lights attached to messages differently?
Look at drawReplacements in the scene manager
I've tried a few times to go down the drawReplacements path, but I've never been able to make it work. I know its possible through there to basically draw a light as a type of replacement for a mesh, but its always used the previous method that wasn't working where the light would just move with the camera since the camera is 0,0,0 every frame, based on the the fact the matricies or transforms aren't being scraped at that point I don't think, since there are no FF calls
and no problem, always appreciate you taking the time away to help out
but yes to answer your question, im trying to do exactly that, since its going to be the easiest way going forward to add real lights into shader games
yeah, im not sure in drawReplacements the transforms for the replacement have been updated to the modified one:
for (auto&& replacement : *pReplacements) {
if (replacement.type == AssetReplacement::eLight) {
if (rootInstanceId == UINT64_MAX) {
// TODO(TREX-1141) if we refactor instancing to depend on the pre-replacement drawcall instead
// of the fully processed draw call, we can remove this requirement.
Logger::err(str::format(
"Light prims anchored to a mesh replacement must also include actual meshes. mesh hash: ",
std::hex, input->getHash(RtxOptions::Get()->GeometryHashGenerationRule)
));
break;
}
if (replacement.lightData.has_value()) {
RtLight localLight = replacement.lightData->toRtLight();
localLight.setRootInstanceId(rootInstanceId);
localLight.applyTransform(input->getTransformData().objectToWorld);
m_lightManager.addLight(localLight, *input, RtLightAntiCullingType::MeshReplacement);
}
}
}
but I can double check. if not I can modify this function maybe to grab the new positions
unless somehow input->getTransformData from the transformbuffers is being made re-visible once processed. anyways. gtg
@honest badger just braindumping my approach here. no obligation to respond obvisouly since y'all are away.
So first, basically I re-wrote a copy of SceneManager::createEffectLight which tries to recalculate the bounding box for the blas geometry for the instance by material data hash (pBlas->input.getGeometryData()).
But this is silly because that is probably the pre-transformed data, and sometimes I think I just get lucky. Those buffers are copied to the GPU, once I read them back it's got undefined data as per the code comment:
// Stores a snapshot of the geometry state for a draw call.
// WARNING: Usage is undefined after the drawcall this was
// generated from has finished executing on the GPU
Possibly sometimes it's the actual post transformed data. That's the only thing that would make sense as to why it is the correct position sometimes, because those buffers are definietely not the BLAS modified geometry data, which for example the GameExporter needs, and I need. It's the only geometry data I am using currently.
Anyways, to call createEffectLight / createTestLight, I just override where it was being called previously in SceneManager::processDrawCallState after the instance manager processes the scene object:
...
RtInstance* instance = m_instanceManager.processSceneObject(m_cameraManager, m_rayPortalManager, *pBlas, drawCallState, renderMaterialData, surfaceMaterial);
// Check if a light should be created for this Material
if (instance && RtxOptions::Get()->shouldConvertToLight(drawCallState.getMaterialData().getHash())) {
createTestLight(instance, pBlas);
}
...
What I think I need to do now is basically copy the pBlas->modifiedGeometry data off the GPU, instead of using the original drawCallState geometry info, which, if im reading the code right, is not going to ever have the post-transformed positionBuffer, unless by some fluke of how the buffer semantics work (undefined).
So during computeRaytraceAxisAlignedBoundingBox (see createTestLight.c comments) instead, I can basically copy that buffer off using some approach like this:
const size_t positionStride = inputPositionBuffer.stride() / positionSubElementSize;
const DxvkBufferSlice positionBuffer(posBuf, 0, posBuf->info().size);
// Ensure no reads are out of bounds, this should be the modified gemoetry buffer
assert(((size_t) (numVertices - 1) * (size_t)inputPositionBuffer.stride() + sizeof(pxr::GfVec3f)) <=
(positionBuffer.length() - inputPositionBuffer.offsetFromSlice()));
// Get copied-to-CPU GPU buffer
const float* pVkPosBuf = (float*) positionBuffer.mapPtr((size_t)inputPositionBuffer.offsetFromSlice());
assert(pVkPosBuf);
// Copy GPU buffer to local VtArray
std::vector<Vector3> positions;
positions.reserve(numVertices);
// XXX: Here we would do some variation of
ctx->copyBuffer(bufferDest, VkDeviceSize { 0 }, buffer.buffer(), buffer.offset(), desc.size);
then we'll have the modified post-transformed positionBuffer copied back, compute the AABB, set the transform, and hopefully its correct 🤞
bleh, uploaded the wrong file
another method would be to write a compute shader which grabs them off the GPU side async, but thats probably gonna be no bueno for lights
yay, this works to get the modified geometry data
woohooo, it works! there's an issue I need to solve where im not waiting for the modified geometry to finish, but the positions are correct!
🥹 finally lights in shader games
@serene trellis finally, lights in ratmix shader games. just use a execution barrier to determine when the GPU is done transforming the positions, then copy them back 
yeah super great for perf. luckily I only need to do it for one draw call out of 800 on average
that might scale to like sub 100, but no more than 100
whas going on in here
making lights work in games that never send a fixed function view transform
i.e shader games
depends what you constitute as fun, probably not, but having shader games have properly working lighting transforms for meshes makes remix better for everyone
so more fun in the future
i hope it goes well then
okay, it works now. unnoticeable overhead with a few lights. @honest badger I think I should be able to integrate this into drawReplacements, and check the drawCallState for vertexshader usage. if yes, it will take a different path that computes the AABB for the RaytraceGeometry and uses that position instead. Hopefully that should be okay? I can profile it if you want to see what the impact would be.
oh and obviously extend it to mesh object replacements intead of just adding a light to a mesh. but thats expensive
WATBULB YOU’RE A GENIUS!!

finally we can have this in TRL too now. well every game can have it. mark is going to yell at me because its expensive. but I mean I'm running the game at 2k there with 1 / 4 bounces and volumetrics on a 2070 and its getting 30 fps
well basically games that use shaders can now have light and mesh replacements
magic 😛
what made that not possible before then
aight
games that use shaders use pre-combined transforms (matricies) by the time they hit the rendering API. You could reverse engineer the game and get the original pre-multiplied transforms, but that can be even more time consuming and difficult. Instead we basically let the GPU process the positionBuffer from the vertexBuffer and transform the geometry from the shader. Once the GPU is finished processing the vertex data, we read its position information back, and use that to position lights in the world
for example a World * View * Projection matrix cannot be decomposed quickly without atleast the projection matrix, and even then it can be difficult to get the actual world position back
so we let the GPU compute the world position and then read it back to where the renderer expects
ion understand any of that but like yeah cool dude amazing as long as it gets it a tiny bit closer to bioshock rtx remix
it'll be ready when its ready 🤷♂️
yuuup
hmm technically I only need to compute the AABB once if its a static mesh. then I can just transform the AABB itself by the new instance transform. the static AABB will only have 8 verticies versus the whole mesh verticies set:
A: previous AABB
B: current AABB
// Split the transform into a translation vector (T) and a 3x3 rotation (M).
B = zero-volume AABB at T
for each element (i,j) of M:
a = M[i][j] * A.min[j]
b = M[i][j] * A.max[j]
B.min[i] += a < b ? a : b
B.max[i] += a < b ? b : a
return B
quite alot better now
it's so beautiful 
have to work on some flickering problem. but I'll pick up on this after the holidays
Enjoy your holiday om gang watlub
you too 🙂
Yeah enjoy the holidays! 🎅
you as well 🙂
Well, that certainly looks like quite a bit of progress.
If you can send off the request to compute the post-shader AABB earlier (possibly even attaching it to the actual vertex shader call), you'd probably reduce the latency this might be causing.
Thanks. I’ll try that. Although it will be a couple weeks possibly until I can.
Learning about the acceleration manager inspired me to actually pick up a book and understand the basics of path tracing. I’ve been having a lot of fun following Peter Shirley’s book
Well book(s). I’m on the second one now
Rat racing in a weekend
Rat racing in the next week
The second book have BVH structures for easier path tracing
Yes I know 😌
I got around the hittable_list.h part but still need to learn more
I can share you my code for the first book if you want
Tbh the first book teaches a ton of bad practices that make me cringe. The book is inconsistent with the code and the code is inconsistent with the book.
- Poor naming of classes
- Forward declarations are a no-no if it’s not needed.
- there’s multiple errors in the book where he uses the pre increment operation on j (++j) instead of post
- the rtweekend is a horrible single header design.
- he includes headers at the bottom of source files
The material is solid but boy is the code bad
Which is a shame because you are supposed to build off it for all the other books
I also don’t really buy his “matter of taste arguments”. Either do it right or do it wrong
Some of it has nothing to do with taste
There’s other issues on the repo that point this out
That's a lot of issues, never thought about them because I'm still learning C++
There's a lot of header files
In his tutorial book
But I'm just here for the concepts behind Path Tracing
I like to nitpick a lot but I also review c++ code for a living so I’m a little biased. I went with even more headers personally with a cleaner structure
oh nice
But yeah what it teaches is super solid. I’d definitely read a couple more books on software construction to get a better insight into some of the more correct design patterns though
I enjoyed code complete a lot when I was in school. But that more focuses on clean code and construction over specifics
Are there some books you can recommend
Like for C++
Right now I feel like you can get a lot of help from online resources and AI assistants but I'd rather rely on myself
Sure. Code complete is one for sure. It’s a huge book, so don’t read it all. In fact I don’t think there are any decent books either than maybe some bjarne books that teach that actual OOP aspect well, it mostly comes down to construction patterns.
Most of the difficulty people have with c++ isn’t really understanding the language itself, especially if you have a fundamentally decent grasp on OOP, but understanding all 4 “meta” languages or paradigms at play when learning C++.
When you are learning C++ you are effectively learning 4 languages at the same time.
-
The core OOP language. And it’s important to stick to this object paradigm and not pretend that C++ is C and vice versa. They are distinctly different languages, so try not to write C code in C++.
-
the STL: the STL is a whole language amongst itself, and for that reason an entire class or book should be dedicated to its understanding and inner workings, it’s not the language, but instead uses the language.
-
You’re learning the language of the computer and compiler and how the choices you make boil down to compiled instructions. People say this doesn’t matter and you can’t outsmart the compiler. Those people are dead wrong. That’s a language amongst itself. Especially when dealing with portability.
The fourth is probably meta programming, but focus on this last
I’m not a big fan of recommending books because books go out of date, I’m more a fan of recommending learning strategies
I’ve been writing C++ for probably 20 years now and I still learn shit all the time
Mythical man month is also a good book. Doesn’t teach programming but instead talks about discipline and practice. Which I find more important. The biggest language nerds are sometimes the worst programmers I’ve even seen because they languish in the limelight of looking at shiny perfect code rather than learning the fundamentals of constructing good code. Focus on that. Its philosophical
I was one of those guys that still bangs on not using boost because I’m tired of swatting a mosquito with a double decker bus
Shit is whack if you ask me
I mean
Yeah it has good stuff but not for learning imo
Also yeah C++ 11 was the last good C++
I subscribe to this now pretty much for a long time
I mean constexpr is pretty good
This is true. I do use that a lot now
I also really like generics
And concepts
But not templates
Also iirc they fixed some thingy in 17 with maybe move semantics i don't remember
You really like oop, huh?
That's a lot to grasp in one go. Have to start somewhere I guess
Nah not really. I only really do C++ at work. I honestly write most of my personal projects in Python because it’s simple and I literally don’t give a fuck how the performance is, I just want to be able to write it fast and now
so good. Maybe before I die someone with a big brain will finally figure out how to make the GIL multithreaded
Like holy shit
I hate the cringe syntax with no brakets for scope ngl
That’s fair
Pythong with brackets coming in Python 4 ™️
I’m kinda a language polyglot tho. I know like 10 or so of them I guess
But I only really use like 4 or 5
Still write C a lot. Still do assembly at work. I do SystemVerilog a lot at work too. Bash for everything that needs to be at my fingertips.
But fuck them web langs
Yes
I’m also a terribly mean person to rusties but I can’t help it
Every bone in my body says I don’t need this
And I don’t need it
Like there’s definitely times at work we’ve written things that take a lot of unstructured user input and write it in rust. But it’s also per application and highly specific.
Some dude at work wrote a documentation generator in rust and I’m just like what the fuck are you doing dude
Like you try to make some Arc thread unmaintainable mutex shit to generate a word doc?
Why?
Use the language for what it’s for. I’m not translating a decade of software to your paradigm because you have fallacies of how allocators and modern compilers work
Also 90% of developers have never looked a static analysis tool, a fuzzer or valgrind in the eye for more than a glancing second
So it makes sense they reach for the thing that saves them from reality
Drugs?
@rich dawn if you get deeper into the materials stuff, I find its better to create a MatProp struct and pass that around versus the lengthy and kinda hard to balance long lines of shared_ptr materials bound to each sphere. I ended up doing it like this to take advantage of designated initializers, which are so much clearer:
// Shapes and their respective materials
using MetalSphere = Sphere<MetalMaterial>;
using LambertianSphere = Sphere<LambertianMaterial>;
using DielectricSphere = Sphere<DielectricMaterial>;
// World objects
auto ground_sphere = LambertianSphere(
Point3f(0.0, -100.5, -1), 100.0,
MatProp<> {
.albedo = Color(0.5, 0.5, 0.5)
}
);
auto center_sphere = LambertianSphere(
Point3f(0.0, 0.0, -1.6), 0.5,
MatProp<> {
.albedo = Color(0.1, 0.2, 0.5)
}
);
auto left_sphere = DielectricSphere(
Point3f(-1.0, 0.0, -1.8), 0.5,
MatProp<> {
.refractive_index = (1.50)
}
);
// NOTE: inside left_sphere
auto bubble_sphere = DielectricSphere(
Point3f(-1.0, 0.0, -1.8), 0.4,
MatProp<> {
.refractive_index = (1.00 / 1.50)
}
);
auto right_sphere = MetalSphere(
Point3f(1.0, 0.0, -1.8), 0.5,
MatProp<> {
.albedo = Color(0.8, 0.6, 0.2),
.fuzz_factor = 0.2
}
);
then when you add them you can just do:
HittableList world;
world.add(std::make_shared<decltype(ground_sphere)>(ground_sphere));
world.add(std::make_shared<decltype(center_sphere)>(center_sphere));
world.add(std::make_shared<decltype(left_sphere)>(left_sphere));
world.add(std::make_shared<decltype(bubble_sphere)>(bubble_sphere));
world.add(std::make_shared<decltype(right_sphere)>(right_sphere));
although idk why peter uses shared_ptrs for materials at all, when they are all unique. he should have used unique_ptr
I'll keep these in mind, though it is hard for me to understand atm 😂
no prob. if you ever have any questions or w/e just hit me up. happy to help
I'll probably post my code on github soon once I finish the second book here
It is supposed to have an experimental test build flag in 3.14 I believe, which should disable GIL completely.
But tbh, it never bothered me. imo using python for high performance cpu-bound scenarios is a design mistake.
I like python the way it is, and it is so easy to interop with C via builtin ctypes lib anyway 
Yeah I’m not saying it bothers me, like I said I use it. It just would be nice. If I need python code to go fast I’ll FFI it to something fast with threads by myself. But multithreaded GIL is a step forward
Or sometimes I’ll tie in a uvloop for some web bound stuff and make that go brrr
Yeah even regular threads are ok for that kind of task, no need for async stuff 
I see Python fitting perfectly as a high level management language who controls the actual work horses written in C/C++ (numpy, opencv, scikit, etc.)
One day I'll find enough energy to write my own game engine with this idea 
For funsies, ofc
Yeah you can’t beat the prototyping iteration time of Python with anything else really. The ecosystem is stupidly strong, including frameworks and libraries. OpenCV with Python versus C++ is like the difference between 10 minutes of work versus 2 hours of work. It’s just not even comparable. And those OpenCV libraries are FFI anyways so the perf (depending) is basically negligible
@serene trellis lol
So many insane abstractions you need a book this thick just to document them all
who the fuck is robert?
He’s a dickhead from Stanford that thinks by teaching his pupils how to program with abstractions at Stanford, he can also force the students to also have to buy his textbook. It’s a cute little conflict of interest. But it happens, a lot.
I mean it’s a decent book. But I always find it weird when the course syllabus is taught by the same guy who is selling you the books
Idk anything about the guy, but sounds like the "uncle" bob thing with "clean" code
It’s a shader game so it doesn’t even support capturing normal buffers so lots of stuff is flat shaded. So to answer the question yes, but for entirely different reasons
have you gotten them to work or are you doing shit manually
Manually. Modifying the runtime source to capture the right buffers and use them properly. Such as for lights as seen here #1144016019195691008 message
I’m hoping to upstream lots of these changes but I just haven’t got the time right now between work and life
damn
What game are you doing?
Hmm. Do you have like an image or something of what they look like or what is not working? Is it just UVs that don’t work and everything else does? Does the logs say unsupported texture format, shaders, etc?
ive really never even checked the logs
let me boot rq
I def would. Might be some useful bits in there
Any of them really
alrighty
I’d at least try disabling alpha processing on the bad textures (you can also disable alpha globally)
And also try ignoring them, or use the debug menu to limit the draw calls until you see it doing the behaviour then see if you can set the materials to flat to debug if it’s some specific material being applied
The banding almost seems like it would be ignorable if coming from a texture or maybe it’s one big screen space texture that’s banding your whole view. It doesn’t look like it’s a UV being applied to every object
Almost like a render target ontop of something weird
Ah yeah that makes some sense. Iirc remix only looks at the one. But if it’s processing on another then flipping the render target result back out into the main it might be janky. I think you can ignore render targets, but otherwise I’m not too sure what the solution for that is. Without thinking on it
most of them are UI
but some just break the entire game
these dont really tell me anything
atleast to me
Hmm the logs seem okay, but the FOV change between frames is a little sus. It does seem like it’s doing some texture target weirdness then applying it on top. I don’t think there’s any way to straight up say don’t accept any actions against this render targets, but you can ignore all the textures used in said render target rendering, and hopefully it won’t be as buggy
Or disable alpha on them, make them world space, etc
I think the UV mapping is probably fine if you get solid looking geometry and hashes in the debug
It’s more like a blending of textures from render target problem
its also assigning random textures to random shit
only alpha textures seem to work without everything breaking
im trying to figure out of its engine balogne or shaders or remix
Damn rip. That could be a side effect of shaders or a texture caching thing they have. Bioshock suffers from the same and I had to patch the game to increase the cache size for the level as to not swap a texture back out to the cache and bring it back in compressed, which causes instability.
If you really really want to figure out what’s going on, you’ll need to probably use PIX and capture a single frame with this behaviour and attempt to see why it’s doing with the textures and render targets
PIX?
Yeah those hashes look good. The lack of character model is probably caused because of geometry skinning and not textures
the model works sometimes
PIX is a legacy graphics debugger for d3d9
when a ingame light is shined on it
#reverse-engineering message
Set that up without remix in a vanilla game, and attempt to capture a frame or a few of them with the F12 experiment
Then you’ll get a per call trace of exactly how it’s rendering your scene
You’ll be able to see it construct it bit by bit
sick alrighty
are you able to assist in helping if i am feeling mentally slow at all
thanks for all the help already though

Probably, but i just might not respond right away. Ping me in your game channel if you have any other questions. Would probably be better to have this convo over there
Yeah np
Pushed my bioshock stuff to: https://github.com/xoxor4d/remix-comp-projects
Hey @honest badger I'm running into an issue where texture hashes change with each reload of a map. I've taken captures after each map load to compare the exported dds files but they are the same - byte for byte, yet have different hashes.
Example random texture on first load: ABCD - second load: EFGH - third load: IJKL - fourth load: IJKL
After a restart, the hash will be ABCD again (but not 100% guaranteed).
I think it only affects textures that contain some emissive part in them .. any idea what might cause that?
Second issue: Vertex normals are packed (ubyte4). Do you think its feasible to unpack them on the remix runtime side or would that have to be done on the bridge before sending them to the runtime?
The actual image hash is calculated here:
https://github.com/NVIDIAGameWorks/dxvk-remix/blob/main/src/d3d9/d3d9_common_texture.cpp#L683
and the DDS save happens here:
https://github.com/NVIDIAGameWorks/dxvk-remix/blob/main/src/dxvk/rtx_render/rtx_asset_exporter.cpp#L95
At a guess, there's something different in the hashed buffer that doesn't make it to the final DDS. you might try break pointing in that function for the different hashes you're getting, and seeing if there's anything different in the image argument.
Second issue: Vertex normals are packed (ubyte4). Do you think its feasible to unpack them on the remix runtime side or would that have to be done on the bridge before sending them to the runtime?
We already handle some form of packed normal here:
https://github.com/NVIDIAGameWorks/dxvk-remix/blob/main/src/dxvk/shaders/rtx/concept/surface/surface_interaction.slangh#L345
but I suspect bioshock isn't packing the normals in the same way Remix does
It may be better to have a pre-process that just unpacks the normals (similar to the skinning pre-pass)
We convert from a 32 byte uint to a normal using the octahedral to sphere method. They're probably using something more like 15 bits for x, 16 bits for y, and 1 bit for z's sign, at a guess.
Thanks a lot for the infos mark! I'll try to make this work 🫣
I assume they are using the same packed format that ue3 uses (this is a ue2.5 game):
Vector.X = Clamp(appTrunc(InVector.X * 127.5f + 127.5f),0,255);
Vector.Y = Clamp(appTrunc(InVector.Y * 127.5f + 127.5f),0,255);
Vector.Z = Clamp(appTrunc(InVector.Z * 127.5f + 127.5f),0,255);
Vector.W = 128;
they're using 8 bits for each direction, and then just wasting 8 bits for a 4th component?
that's just wasteful
Are they doing that through fixed function, or do those go to some vertex shader?
There is almost no fixed function rendering left in ue2.5 so all of that goes to vertex shaders. Looking at one, this looks like part of the unpacking:
def c31, 0.00784313772, -1, 1, 0 // 0.00784313772 ≈ 1/127.5
dcl_normal v3
mad r3.xyz, v3, c31.x, c31.y
..
Does our vertex shader capture feature work for it?
Toggling capture normals from shader does not seem to make a noticeable difference .. I'm honestly not sure. It is really noticeable on bsp but that now renders via fixed function for some reason
New commit fixes alpha blending / emissive issues and comes with pretty good anti culling tweaks getting rid of most light leakage 👍 Action build is currently building: https://github.com/xoxor4d/remix-comp-projects/actions
Update: I've fixed some of the vertex normal issues by unpacking them and modifying the vertex buffers on the fly. Happens on each draw for the viewmodel and only once for static buffers such as bsp. Also fixed some minor other issues
You know, you could have messaged me and we could have worked together on this or something, but I come back after being away for a few months to see this is a little disappointing and quite a slap in the face to the months of work I put into this. I think I'll be checking out of this project for now.
this is caused by the texture streaming cache, you need to set the appropriate scale and streaming visible weights for emissives so they don't get flushed
Sorry didn’t want to disturb you in whatever you were doing and I thought I could summon you like this eventually 👀 Would gladly cooperate on this one if you are up for that but I’ll be quite busy with other remix projects for a while so there will not be much or any work on this from my side
Would be great if you could contribute on that (if you want to ofc)
I understand, and fwiw I'd like to work on something like this with you as well, at the least to make sure you're not duplicating efforts and vice-versa. To be honest I was just a little taken a back that you just posted a link to your repo -- if this is a game you'd like to tackle as well I was just surprised that you'd just attempt to do it from scratch without maybe chatting about it first. But I also didn't know you didn't want to disturb me, so that's fair.
I think if we work on this together I'll need to merge several levels of our projects together and im not sure what the best way to do that is right now, but I can start picking away at some pull requests, as I follow a somewhat similar hierarchy, but with a lot of specific differences too. I need to spend some time seeing where exactly you are at and what I can even port over, assuming you want to actually do a complete mod for this game.
fwiw, it is really hard to keep tabs of who is working on what and when, if they're still working on it or abandoned, or if they're even open to share efforts or prefer to keep things soloing by themselves (I.e not everyone is a MIT license fan lol).
NFSU1 Rtx has like, 3? 4? ongoing projects that came and go over the time, can't recall 
well I mean that's fair, but also sending a message takes 5 seconds (I also don't think NFS is a fair comparison to this, those aren't compatibility mods, the game already works, those are more subjective)
WATBULB!! Welcome baaaack! 
Hi!!!
I'd gladly let you handle the project because I'm not really into bioshock and was just a short little side quest 😂
You are free to use the code / research in your project if you want so you don't have to fiddle with my code base / pull requests 👍
Okay, sounds good, I really appreciate it.
Installed this on the GOG version of the game, but I just can't get it to work for some reason.
RTX-Comp Debug Console just says: [INIT FAILED] Unsupported Game or Version of the Game!
Remix hooks, there's no cursor visible, only UI elements render (also, when I pause and unpause, the pause menu will stay on screen with other UI elements render ontop). Imgui also doesn't open at all using F4 or F5.
I followed the guide, made sure every file is where it says to go, so I'm a bit lost as to what's going on. I'm on GOG, BioShock 2007 v1.1, clean install, but no luck unfortunately. Any idea what's going wrong?
this never got posted here i guess
Ah I did try this version and it works, I just got confused as to which is the most updated since I saw some back and forth between xoxor and watbulb. Thanks 👍
How far into the game does the mod cover? Does the intro work?




