-
Posts
696 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Dzsozi (h03)
-
I think it doesn't matter if I give "all" instead of "world" and "object" and then use engineRemoveShaderFromWorldTexture function on players and vehicles. Also, that is not the problem, the problem is written above, I just need solid green textures, without model shadows and such.
-
Kinda what @pa3ck said. I just want to render everything green, like there is a dxDrawRectangle on the screen, but you can still see the players and vehicles, so I can just move around while everything is green and just take a screenshot, then put that image in photoshop or some image editor software and cut around the character or vehicle easily. That way I could avoid pixelated edges. And the reason I would like to make it as a shader or something similar, not with objects or 3D drawing things, is that I could make for example a rancher look like its driving over a rock on the hills, so the wheels look like there is something under it, but only the rancher would be visible, so I could make artworks and in-game commercial pictures, etc., I hope you could understand me this time. I just want to render EVERYTHING green, EXCEPT the players and the vehicles that are occupied, while I can just move around.
-
That's not what I want to do.
-
Alright, so I checked out what @pa3ck sent here, the topic, and I got the stuff from there, changed it up a little bit, and yes, everything changed to green, but I still have some problems: First of all, this is still not the result I would like to get, how I could remove the shadows and textures, since this is just changes the texture color, as I can see. My second problem is that as you can see on the picture, there are still some textures that not even get colored, how I could fix that? The third problem is that whenever I get into a vehicle, for some reason it remains green, but I can't see any errors in the script, not even debugscript outputs any, here's my current code: local myShader = dxCreateShader('greenscreen.fx', 0, 0, false, 'all') dxSetShaderValue(myShader, 'red', 0.0) dxSetShaderValue(myShader, 'green', 1.0) dxSetShaderValue(myShader, 'blue', 0.0) dxSetShaderValue(myShader, 'alpha', 1.0) engineApplyShaderToWorldTexture(myShader, '*') addEventHandler("onClientRender", root, function() local players = getElementsByType('player') for _, player in ipairs(players) do local vehicle = getPedOccupiedVehicle(player) if vehicle then engineRemoveShaderFromWorldTexture(myShader, '*', vehicle) end engineRemoveShaderFromWorldTexture(myShader, '*', player) end end) And the shader: float red; float green; float blue; float alpha; technique simple { pass P0 { MaterialAmbient = float4(red, green, blue, alpha); } } By the way, is there any way to draw a dxRectangle or something and then draw the players and vehicles on top of it? I guess that would be one more way to do it, but I don't know if it is possible, because it seems like that this won't work, with this shader. I appreciate your answer, but this is not what I would like to do, I would like to make the screen/everything green, except players and vehicles that are occupied, so if I take a screenshot and put it to photoshop I can make nicer artworks without choppy and ugly edges.
-
I might try that, just to see how it would look like, but I still prefer the shader/other similar method, because if I want to make an artwork of the rancher for example, and I would like to make it look like it's driving through an obstacle, I must go on to a rock or something to make the wheels look correct, hope you know what I mean. However, if somebody could help me out with the shader method or has any other idea, please reply.
-
That's not good for me, what about the ground? I would prefer if I could make everything green except the players and occupied vehicles, just to be sure that I can get the best results. I also think that I don't necessarily need shaders, but as I said, I can't think of another solution.
-
It doesn't work also: Not the result I was expecting
-
Hello! So, I would like to make something like a green screen shader, so I can take screenshots of players and vehicles, but I have never created or done shaders, my HLSL knowledge is 0, I don't know how shaders work. The effect I would like to reach looks like this (image taken from google): So how I would like my script to work: when I start the resource, there would be a colored texture applied to everything, except the local player, or if he/she is sitting in a vehicle then remove the shader from the vehicle as well. Like a green pane would appear behind the characters/vehicles, but I keep failing with my script. I don't know what would be the most efficient way to do this, I was thinking about this, but there might be other, easier methods as well, but I can't think about anything else. As I said before, I'm not experienced with shaders at all, could somebody help me out with this script? I would need this so I can make artworks and such, I would be really grateful! Here's my script: local sx, sy = guiGetScreenSize() local screenColor = {0,255,0,255} addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() greenScreenShader = dxCreateShader ( "greenscreen.fx",0,0,false,"all" ) local texture = dxCreateTexture ( sx, sy ) dxSetShaderValue ( greenScreenShader, "greenScreenTexture", texture ) dxSetShaderValue ( greenScreenShader, "screenColor", screenColor[1]/255, screenColor[2]/255, screenColor[3]/255, screenColor[4]/255 ) engineApplyShaderToWorldTexture ( greenScreenShader, "*" ) engineRemoveShaderFromWorldTexture ( greenScreenShader, "*", localPlayer ) end) local screenOutput = dxCreateScreenSource( scx, scy) addEventHandler ( "onClientHUDRender", root, function() if greenScreenShader then local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then engineRemoveShaderFromWorldTexture ( greenScreenShader, "*", vehicle ) end dxDrawImage( 0, 0, scx, scy, screenOutput, 0,0,0) end end) And my shader file (probably wrong, I don't even know what does things mean here, I copied these from other shader files): texture greenScreenTexture; float4 screenColor = float4(0.0 / 255.0, 255.0 / 255.0, 0.0 / 255.0, 255.0 / 255.0 ); technique simple { pass P0 { Texture[0] = greenScreenTexture; } } And this is the result I get: Could somebody help me out with this? Thank you for your answers in advance!
-
UPDATE (1.0.3): - Added possibility to disable backgrounds with a variable - Disabled distance check on the Z axis, since this is a 2D display - textOffset works automatically now (you don't have to change that if you disable the background or change the image/background sizes)
-
[REL] New Dx Server Rules ( No Binds & No Commands ) NEW!
Dzsozi (h03) replied to xMKHx's topic in Resources
Good job, looks nice! -
What do you mean? What does imp mean?
-
Thank you for your feedback! <3
-
Thank you!
-
QUICK UPDATE: Made the distance numbers more easy to read by adding convertNumber function - before: 3328 | after: 3,328
-
Haha, thank you, this made my day! I wish you the same!
-
Have you ever experienced the awkward moment when you had to check your large map to see which direction you have to go? This resource lets you make important blips visible on players' screen, something you would see in games like Watch Dogs or Assassin's Creed. The only thing you have to do is set a "blip.visibleOnScreen" element data to true for a blip you would like to make visible, and the blip will be always on your screen, aiming towards the position of the blip. Check the examples given in the script. This DOES work on every resolution, blips won't go out of screen, so no need to be afraid or edit because of that. You can see the distance between the blip and you under the blip image as well. Edit this resource however you want, all I ask for is to leave the credits for me. (I used different blip images from my radar resource on the pictures, feel free to change them.) QUICK UPDATE: Made the distance numbers more easy to read by adding convertNumber function - before: 3328 | after: 3,328 Video preview (sorry for the bad video quality, I don't know why it is that bad): Screens: Changelog: UPDATE (1.0.1): - Made the distance numbers more easy to read by adding convertNumber function - before: 3328 | after: 3,328 UPDATE (1.0.2): - Removed leftover unnecessary lines from the script that I needed for debug used for my radar UPDATE (1.0.3): - Added possibility to disable backgrounds with a variable - Disabled distance check on the Z axis, since this is a 2D display - textOffset works automatically now (you don't have to change that if you disable the background or change the image/background sizes) UPDATE (1.0.4): - Fixed a typo UPDATE (1.0.5): -Fixed typos -Improved fading (not sketchy anymore, fades perfectly and smooth) -Removed unnecessary lines Download: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14531
-
Makes sense if talking about realism, I might change up these things.
-
It is not caused by the handling, I just tested it on the admiral, copied the handling line from the downloaded handling.cfg for admiral and applied it in-game using handling editor, the same handling got applied like in the video, but when I flipped I kept sliding on the ground, so I think this has to do something with the surface.dat file, the handling is just for more realism I guess.