Popular Post Epifire 785 Posted October 15, 2017 Popular Post Report Share Posted October 15, 2017 I think this may have been asked a couple times before but I'd never really been around for the conversation myself. As we have many more coders frequenting the mod (more than what feels like the usual anyway) I thought this would be an appropriate time to ask. This isn't to say I'm requesting the feature, more less inquiring on how plausible it is to accomplish within TDM and get feedback. This is an appropriate vid to show what I mean and it seems to be a project a lot of older engines undergo later on in their lifespan... https://www.youtube.com/watch?v=ZH6s1hbwoQQ This has a very powerful result and seems rather straight forward after implemented. I for one would use this to the fullest extent were it available to me in TDM. I guess that really comes down to what people think about this and really, is it a viable feature that can be implemented? EDIT - 10/15/17: Here is the test PK4 to fiddle with the cubemaps on... https://www.mediafire.com/file/3n19ri43bxs2raa/parallax_cubemaps.pk4 8 Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
duzenko 659 Posted October 15, 2017 Report Share Posted October 15, 2017 This has a very powerful result and seems rather straight forward after implemented. I for one would use this to the fullest extent were it available to me in TDM. I guess that really comes down to what people think about this and really, is it a viable feature that can be implemented?Could you whip up a test map for this? Quote Link to post Share on other sites
Epifire 785 Posted October 15, 2017 Author Report Share Posted October 15, 2017 Could you whip up a test map for this? Yeah I probably could. Just could do a glossy floor mtr or something like the other tests did. Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
peter_spy 1602 Posted October 15, 2017 Report Share Posted October 15, 2017 I'd definitely use this as well. Haven't tried a regular cubemap on the floor yet, and it would probably need to be a static mesh floor to have a proper point of origin. It's definitely something worth checking. Quote Misc. assets for TDM Link to post Share on other sites
Epifire 785 Posted October 15, 2017 Author Report Share Posted October 15, 2017 I'd definitely use this as well. Haven't tried a regular cubemap on the floor yet, and it would probably need to be a static mesh floor to have a proper point of origin. It's definitely something worth checking. Currently I've been using cubemaps for generic sky reflection to windows and exterior reflective surfaces that don't need localized sources. I gotta figure out the correct method I asked about a while back to have proper projections in env_shot, though I think I can manage once I try that again. Could you whip up a test map for this? I imagine a simple room with pre-captured cubemaps shall suffice? I'm very curious how many captures a larger room would need as I usually see newer engines sample out multiple capture nodes along a single, long surface. Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
peter_spy 1602 Posted October 15, 2017 Report Share Posted October 15, 2017 Thet might come in handy: https://seblagarde.files.wordpress.com/2012/08/parallax_corrected_cubemap-siggraph2012.pdf Quote Misc. assets for TDM Link to post Share on other sites
duzenko 659 Posted October 15, 2017 Report Share Posted October 15, 2017 I imagine a simple room with pre-captured cubemaps shall suffice? I'm very curious how many captures a larger room would need as I usually see newer engines sample out multiple capture nodes along a single, long surface.Let's start with that Quote Link to post Share on other sites
stgatilov 1222 Posted October 15, 2017 Report Share Posted October 15, 2017 Do I understand it right that this effect is only applicable to an absolutely horizontal floor?Also, can't it be implemented as a mirror instead of floor with some sort of addition (transparent geometry on top)? Quote Link to post Share on other sites
duzenko 659 Posted October 15, 2017 Report Share Posted October 15, 2017 Do I understand it right that this effect is only applicable to an absolutely horizontal floor?Also, can't it be implemented as a mirror instead of floor with some sort of addition (transparent geometry on top)?It should work with the existing mirror function for single flat surfaces. Quote Link to post Share on other sites
nbohr1more 2160 Posted October 15, 2017 Report Share Posted October 15, 2017 Hmm. I wonder if we have the map from this wiki around: http://wiki.thedarkmod.com/index.php?title=Cube_maps and how much of a test case it could be used for. Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...) Link to post Share on other sites
duzenko 659 Posted October 15, 2017 Report Share Posted October 15, 2017 It should work with the existing mirror function for single flat surfaces.On a second thought, mirrors show player's model by default. Not sure if it's a problem in this case though. If it is, we might want to add a noplayer flag or something. Quote Link to post Share on other sites
nbohr1more 2160 Posted October 15, 2017 Report Share Posted October 15, 2017 Lol. Mirrors already do this and more but require "full scene rendering". This is for "faked reflections". That said, for mirror surfaces we don't want the player to be seen in (such as water): http://bugs.thedarkmod.com/view.php?id=800 there is the suppressSurfaceInViewID call. Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...) Link to post Share on other sites
Epifire 785 Posted October 15, 2017 Author Report Share Posted October 15, 2017 Lol. Mirrors already do this and more but require "full scene rendering". This is for "faked reflections". That said, for mirror surfaces we don't want the player to be seen in (such as water): http://bugs.thedarkmod.com/view.php?id=800 there is the suppressSurfaceInViewID call. Is there ever a time where cubemaps can be used to draw the majority of the scene (all excluded) with only moveables referenced in real time reflections (such as NPCs or torches)? It's the consideration if perf friendly cubemaps could be combined with only flagged entities to grant less costly dynamic reflection capture. A hybrid if you will. Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
Obsttorte 1505 Posted October 15, 2017 Report Share Posted October 15, 2017 It should work with the existing mirror function for single flat surfaces.Mirrors are very performance-intensive, though. So unless one really need a real-time reflection it is preferable not to use it. Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
Epifire 785 Posted October 16, 2017 Author Report Share Posted October 16, 2017 Could you whip up a test map for this? Here it is! I kinda went a little nuts and decided to make some marble stuff from scratch just for a fun day project. It should all be there (minus the parallax correction obviously) but anyone can crack this open to have at it. Hopefully my envshot reference position will suffice, otherwise you can certainly capture another if need be. https://www.mediafire.com/file/3n19ri43bxs2raa/parallax_cubemaps.pk4 4 Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
Bikerdude 3741 Posted October 16, 2017 Report Share Posted October 16, 2017 (edited) @Epi, the image is very dark fella. So corrected and it can sorta see, maybe make a short vid..? Edited October 16, 2017 by Bikerdude 1 Quote Link to post Share on other sites
Epifire 785 Posted October 16, 2017 Author Report Share Posted October 16, 2017 @Epi, the image is very dark fella. So corrected and it can sorta see, maybe make a short vid..? rmQpcbs (2).jpg Might wanna adjust the monitor contrast? The brights get pastie at that level, as it's intentionally dark with the lit paintings to pop the threshold for the cubemap reflections. People can record videos on that if they like but I had nothing else to show besides the screenshot. Obviously we'll be seeing videos if someone gets a parallax corrected reflection working though, but you're certainly free to download and inspect the scene for yourself. Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
Bikerdude 3741 Posted October 16, 2017 Report Share Posted October 16, 2017 Might wanna adjust the monitor contrast? but you're certainly free to download and inspect the scene for yourself.I tried on a PC and Max laptops at work, both were too dark. And yep doing that now, as I wasnt able to at work. Quote Link to post Share on other sites
Bikerdude 3741 Posted October 16, 2017 Report Share Posted October 16, 2017 (edited) Very impressive work, Im hoping someone can crack the parralax correction as that would awesome (Calling Obsttorte..?). How did you take the ENV shot, what args did you use..? and could this ENV image be place on a single flat surface? Im thinking of this as faking the interiors of building as the player walks around a map for example.. Edited October 16, 2017 by Bikerdude Quote Link to post Share on other sites
Epifire 785 Posted October 16, 2017 Author Report Share Posted October 16, 2017 They're fairly expensive to create as it's a a series of six images it prints off. Quoting AluminumHaste's console line from the newbie thread I basically used the following (envshot cubetest 2048 24). 4:3 aspect ratio with 640x480 screen resolution and that's it. It's fairly user intensive as you've gotta have a different mtr reference to handle each instance of when a unique cubemaps keyname is used. So capture, and then create a new mtr instance that probably works best as optional skins. Granted the skins naming convention is only relative to the map it's used in, it's probably the best method right now. Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
duzenko 659 Posted October 17, 2017 Report Share Posted October 17, 2017 I did not have time to look at the map yet due to RL issues but can you try this light: lights/mountain_sunset { ambientCubicLight lightFalloffCubeMap env/skyboxes/skybox_mountain_sunset/mountain_sunset { cameraCubeMap makeIrradiance(env/skyboxes/skybox_mountain_sunset/mountain_sunset) colored zeroClamp } } lightFalloffCubeMap is specular and cameraCubeMap is diffuse.Replace env/skyboxes/skybox_mountain_sunset/mountain_sunset with your cubemap here.Will only work with 2.06/svn. 1 Quote Link to post Share on other sites
peter_spy 1602 Posted October 17, 2017 Report Share Posted October 17, 2017 In the video posted above, they use 3 "cubemap samplers" so they cover the whole street area. Unity uses "reflection probes". Maybe it would be better to take a look how it's done in other engines, and try to copy that solution. Quote Misc. assets for TDM Link to post Share on other sites
Arcturus 694 Posted October 20, 2017 Report Share Posted October 20, 2017 Blender developers are making new real-time engine called Eevee. It's part of the Blender 2.8 project. 1 Quote It's only a model... Link to post Share on other sites
Epifire 785 Posted November 3, 2017 Author Report Share Posted November 3, 2017 I did not have time to look at the map yet due to RL issues but can you try this light: lights/mountain_sunset { ambientCubicLight lightFalloffCubeMap env/skyboxes/skybox_mountain_sunset/mountain_sunset { cameraCubeMap makeIrradiance(env/skyboxes/skybox_mountain_sunset/mountain_sunset) colored zeroClamp } } lightFalloffCubeMap is specular and cameraCubeMap is diffuse.Replace env/skyboxes/skybox_mountain_sunset/mountain_sunset with your cubemap here.Will only work with 2.06/svn. Sorry hadn't seen your reply since I apparently hadn't set notifications on the thread like I thought I did. I'm not working out of the SVN so that might take a little bit to move this over, I suppose if it's just the PK4 I might be able to manage that. I've never actually used cubic lights as I wasn't sure what all they did but it would definitely be worth looking into. Quote You need a model? Epi does you a model. Toss me a PM I promise I don't bite. Link to post Share on other sites
Popular Post cabalistic 794 Posted April 26, 2020 Popular Post Report Share Posted April 26, 2020 Sorry for resurrecting an old thread, but I thought this might interest a few people (I accidentally applied the wrong normal map to the floor, so ignore those artefacts you may see.) This works by means of a new custom shader, which I've attached to this post. I don't know if it'll land in the upcoming 2.08 release, but you could also bundle the shader with your map, and it should even work in 2.07. How to use it? Well, it's admittedly not super user-friendly. You'll need the regular cubemap capture as before. But in addition you'll also need the world position from where the cubemap capture was taken, and you need to specify an axis-aligned bounding box that approximates the captured geometry in the cubemap. This means that this technique works best in rectangular-shaped areas (like in Epifire's test map from this video), and that rectangular shape should be axis-aligned. You can of course still define an axis-aligned bounding box for non-rectangular or rotated geometry, but it'll probably not look as good. Since there's currently no support from DR or the game to get those parameters, you'll have to measure those three positions yourself (cubemap capture position and AABB min and max corners), either in DR or in the game with noclip and getviewpos. They don't have to be exact, but it'll look better if they are not totally off. Now, in your material, you'll need to replace the default cubemap reflection stage, i.e. this part: { blend gl_dst_alpha, gl_one cameraCubeMap env/cubetest texgen reflect } Replace it with the following: { blend gl_dst_alpha, gl_one program parallaxCubeReflect vertexParm 0 0, 40, 100, 0 // cubemap capture position vertexParm 1 -130, -240, 0, 0 // proxy AABB min vertexParm 2 130, 320, 200, 0 // proxy AABB max fragmentMap 0 cameraCubeMap env/cubetest // reflection cube map fragmentMap 1 _flat // normal map } vertexParm 0,1,2 are the cubemap capture position and the AABB min and max corners in world space, respectively. fragmentMap 0 is the actual captured cubemap, and fragmentMap 1 is the normal map for your surface (or '_flat', if you don't want one). parallax_cubemap_shader.7z 7 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.