Olby Posted January 13, 2016 Share Posted January 13, 2016 I am trying to make sure that "camera objects", such as weapons, never go through the level geometry. Back in the DarkBasic days there used to be a command to disable object's z-depth. I think the closest match in LE is the Depth Test setting in the material editor. In the image below I disabled depth test for both the shotgun and the hand's materials. Either or but the result is not what I expect. I need the model "to be on the top" of everything else while maintaining the visual integrity. Thanks. Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
ChrisV Posted January 13, 2016 Share Posted January 13, 2016 Seems to me like you'd need to set the min and max range of your cam (clipping), and use two cams, instead of one...one for your weapon which has a max view range of say 10, and another cam that renders everything else besides your weapon. Not sure if LE has that option, but at least that's the way it's usually done. You could also try by making the collision shapes for your walls a bit bigger, thus preventing your weapon to go inside the walls. Or, you could use a raycast method, and when your character is at a certain range of a wall (or other object), make the arms retract (using an animation), so that the weapon doesn't go through. Btw, loved DarkBasic Pro. Brings back good memories. 1 Quote My Artwork. ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3 Link to comment Share on other sites More sharing options...
Slastraf Posted January 13, 2016 Share Posted January 13, 2016 Two cameras have an impact on the performance, it doesnt matter which range you set it to (for me). I get 30 fps when I have two cams in the scene. Quote Link to comment Share on other sites More sharing options...
reepblue Posted January 13, 2016 Share Posted January 13, 2016 You need a model shader that always draws in-front of everything else, but not in front of any other faces with the same shader. How to do it? Beats me, ask Shadmar as I've been wondering the same thing. 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Olby Posted January 13, 2016 Author Share Posted January 13, 2016 Sometimes I miss the simplicity of the fixed function pipeline. You had commands to do this and that. And now since I've never fully learned HLSL nevermind GLSL it is beyond me as well. Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
Josh Posted January 13, 2016 Share Posted January 13, 2016 When you have accurate lighting it introduces the possibilities of glitches you didn't know you could have. For example, even if you render the weapon in a second pass on top of the scene, the gun will get the shadow's wall on it when it goes through the wall. This can be observed in the game STALKER. I would do a line pick and lower the weapon when you are up against a wall. That's the only realistic way to solve this. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted January 13, 2016 Share Posted January 13, 2016 I'm sure there is a way to get the effect that you want. If anything, it can be the view models are too long. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
shadmar Posted January 13, 2016 Share Posted January 13, 2016 You can't solve this in a shader, the problem is.. the gun is not .. a model.. it's 3 models. Hand, cob, barrel (orso).. I'd do as Josh says, or quickly switch the 3-model gun to a 1-model gun and turn off depth-test when near a wall. 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
reepblue Posted January 13, 2016 Share Posted January 13, 2016 You can't solve this in a shader, the problem is.. the gun is not .. a model.. it's 3 models. Hand, cob, barrel (orso).. I'd do as Josh says, or quickly switch the 3-model gun to a 1-model gun and turn off depth-test when near a wall. The gun is a model, it just uses 3 different materials. If the view model was set up right, I think disabling depth test would be the answer then. Thanks for the info. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
ChrisV Posted January 13, 2016 Share Posted January 13, 2016 I would do a line pick and lower the weapon when you are up against a wall. That's the only realistic way to solve this. As i suggested earlier. It's not the most commonly used method, nor the only one to solve this problem, but it does add to the realism and it's not too difficult to do. 2 Quote My Artwork. ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3 Link to comment Share on other sites More sharing options...
Olby Posted January 13, 2016 Author Share Posted January 13, 2016 Thanks. At least now I have an easy solution. 1 Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.