ZuluTangoDelta Posted September 27, 2014 Share Posted September 27, 2014 Hi i want to render multiple times the same Vertexes. Its possible with multiple vertexshaderfunction in the shader. But is there anothere way?Because i need more than 4 multiple vertexpositions of one vertex and 4 vertexfunctions dont look good Link to comment
Ren_712 Posted September 27, 2014 Share Posted September 27, 2014 Whatever works is enough. You might do it as You already mentioned or You could create 4 layered shaders - that will work in separate passes [shader1 = dxCreateShader("shader.fx",0,0,layered = true) ... and so on] These 2 methods create the same results, Of-course, you'll always have to deal with z-fighting (just like using 1 shader effect with multiple passes). Because i need more than 4 multiple vertexpositions of one vertex and 4 vertexfunctions dont look good (To avoid Z fighting artifacts, you may have to add DepthBias=-0.0002 ; to the technique pass [multiply the value by 2 for another pass]) Instead of creating separate vertex shaders. Or just pass some value to the vertexShader function in the technique passes - then you'll need only a single function - look into shader_radial_blur for an example. https://nightly.multitheftauto.com/files/shaders/ ... l_blur.zip Link to comment
ZuluTangoDelta Posted September 27, 2014 Author Share Posted September 27, 2014 Ah ok thanks Another Question(i hope i can post that here because it has something to do with this shaderscript). Id tried to make a fake glow Object with morphing the original object. Then set the alpha alittlebit down.Works fine....But the murphed glowobjects are rendered behinde other objects/worldobjects. In the ped shell script they solved that problem by set the alpha of the player to 254. Doesnt work for my morphed objects I tried many things but with no result Do you know a solution? better picture: http://www.pic-upload.de/view-24749381/mta-screen_2014-09-27_22-24-24.png.html Link to comment
Ren_712 Posted September 28, 2014 Share Posted September 28, 2014 As You noticed - setting object alpha doesn't necessary make it render after the background objects (unlike peds and vehicles). You shouldn't setElementAlpha to 254 for objects - it makes the layered effect render before everything else. A trick would be to use model replace functions https://wiki.multitheftauto.com/wiki/EngineReplaceModel. Notice the alphaTransparency flag - set it to true. Currently this is an only solution for the problem. So yeah, extract the model from gta3.img (or wherever it is) and replace it with itself using said EngineReplaceModel function. Or maybe just setting the element alpha back to 255 would be enough ? Link to comment
ZuluTangoDelta Posted September 28, 2014 Author Share Posted September 28, 2014 So much thanks Ren_712 It works by setting the enginereplacemodel boolean "alphaTransparency " to true for the wanted glowobject. Layered Shaders are tricky Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now