50p Posted October 31, 2011 Posted October 31, 2011 Hi there people! I have been absent for long time and probably won't be as active as I used to be but I'll do my best. I just found out that MTA can load effect files and I wanted to learn how to write shaders. So far I have written only 1 very simple shader but I've learnt the basics how the whole process works (only pixel shading though) and should have some more. Here is my very first shader: - Horizontal flip - it flips your screen horizontally! Imagine that you know all 3 cities in SA. Will you know all the cities if the entire game was flipped horizontally? I bet it will take some time for you to know which turn to take to take you to the place where you want to go. I got lost multiple times when I wanted to get to Grove Street from 4 Dragons Casino. Download
MetaGamer Posted October 31, 2011 Posted October 31, 2011 good work and please buddy update the MTA Script Editor.
Faw[Ful] Posted November 1, 2011 Posted November 1, 2011 Nice , thats been awhile since I had not seen something funny like that. Mirror racing like in mario kart FTW
Xierra Posted November 1, 2011 Posted November 1, 2011 Wow! Mirrored GTA World! Awesome! I think some kind of mirrored route races are possible now. 50p, your first shader was one of the most interesting, things will get more confusing with this Go and learn shaders more, then you'll be able to make cool shaders such as this one!
50p Posted November 1, 2011 Author Posted November 1, 2011 Thanks for the comments guys, I didn't know you'll like it. Anyway, a little update: * added: flipped keys to make the driving easier (Mouse movement is not flipped though, can't think of the easiest way to do it. I don't want to make custom camera control to make it since this shader was made just for fun and shader writing practice)
karlis Posted November 1, 2011 Posted November 1, 2011 dont see a mayor problem in lack of that 1)invert mouse 2)profit!
CapY Posted November 2, 2011 Posted November 2, 2011 dont see a mayor problem in lack of that1)invert mouse 2)profit! Invert keys if possible
Wojak Posted November 2, 2011 Posted November 2, 2011 nice, bud using shaders to flip the image is little overpowered local w, h = guiGetScreenSize( ) screenSrc = dxCreateScreenSource( w, h ) addEventHandler( "onClientPreRender", root, function() dxUpdateScreenSource( screenSrc ) dxDrawImage( 0, w, -w, h,screenSrc ) end )
karlis Posted November 2, 2011 Posted November 2, 2011 nice, bud using shaders to flip the image is little overpowered local w, h = guiGetScreenSize( ) screenSrc = dxCreateScreenSource( w, h ) addEventHandler( "onClientPreRender", root, function() dxUpdateScreenSource( screenSrc ) dxDrawImage( 0, w, -w, h,screenSrc ) end ) does it work? i suppose it shouldnt.
Wojak Posted November 2, 2011 Posted November 2, 2011 local w, h = guiGetScreenSize( ) screenSrc = dxCreateScreenSource( w, h ) addEventHandler( "onClientPreRender", root, function() dxUpdateScreenSource( screenSrc ) dxDrawImage( w, 0, -w, h,screenSrc ) end ) now it's ok, I've misplaced one "w" (my rear view mirror script is a prove...)
karlis Posted November 2, 2011 Posted November 2, 2011 oh i thought it just moved the bounds, not inverted the pixels, nice find!
50p Posted November 2, 2011 Author Posted November 2, 2011 local w, h = guiGetScreenSize( ) screenSrc = dxCreateScreenSource( w, h ) addEventHandler( "onClientPreRender", root, function() dxUpdateScreenSource( screenSrc ) dxDrawImage( w, 0, -w, h,screenSrc ) end ) now it's ok, I've misplaced one "w" (my rear view mirror script is a prove...) Doesn't that flip HUD as well?
karlis Posted November 2, 2011 Posted November 2, 2011 local w, h = guiGetScreenSize( ) screenSrc = dxCreateScreenSource( w, h ) addEventHandler( "onClientPreRender", root, function() dxUpdateScreenSource( screenSrc ) dxDrawImage( w, 0, -w, h,screenSrc ) end ) now it's ok, I've misplaced one "w" (my rear view mirror script is a prove...) Doesn't that flip HUD as well? it is PRErender btw if pre doesnt work, use onClientHUDRender, it is triggered be4 hud is drawn.
Wojak Posted November 2, 2011 Posted November 2, 2011 its impossible to capture hud components and dx elements into screen source, so when you use prerender they are drawn on top
MTA Team qaisjp Posted November 3, 2011 MTA Team Posted November 3, 2011 inverted canera can be done using freecam. great stuff 50p
Spanish4Life Posted November 11, 2011 Posted November 11, 2011 Hey, more shaders? It's good but you can do anything more
Spanish4Life Posted November 11, 2011 Posted November 11, 2011 (edited) but if "shaders" do one more atleast >_> or change it, it sounds like a liar Edited November 11, 2011 by Guest
50p Posted November 12, 2011 Author Posted November 12, 2011 LOL OK, I'll write a black&white shader and use it when you die, you know, like in GTA IV. In fact, I did write such shader but I lost it due to C:\ format
karlis Posted November 12, 2011 Posted November 12, 2011 also add the zoomout and camera roll effect to it(not really a shader)
50p Posted November 12, 2011 Author Posted November 12, 2011 also add the zoomout and camera roll effect to it(not really a shader) If I was to make such resource I would add it but it's just a shader and you can add it yourself I might add it in the future but first I have to fix MTASE to work with MTA SA 1.1
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