Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by ZuluTangoDelta

  1. Ah ok thanks :D 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 :S I tried many things but with no result :/ Do you know a solution?


    better picture:


  2. 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 :D

  3. Hi i have little big problem :D

    I want to apply a bloom shader only on one texture. My idea was to render a screentexture on which only the wanted texture appears on(other textures are black). Then i blend it with the original screensource.But I dont get it :/How can I render a scene from the game with only one texture(other textures must be black).

    I tried it but i can only render one scene on one frame. I mean i can only render the original scene or the wanted bloomtexture.The only option which i see is to render each one for one frame.But then i have only the half framerate :(

  4. Ok thanks.i had this idea too.I work with a kind of "chunks" like minecraft^^ because the map will be very very big(Objects >100.000)

    But i got problems with reading more than 500 files.(i want to create for each chunk a file [1600 chunks] )

    Is there any other methode to store many objects?I work with tables and i dont know what the limit of tables are :S Probably i need to create more than one table to store the informations.

  5. Hello i try to store objects.The objectsinfos(position,model,rotation) are stored in a table.When i want to safe the table informations i create a txt file(looks like this["Chunk:44; model:3345; x:-3300.7; y:-3700.3; z:40; rx:0; ry:0; rz:0|"].If there are 30000 objects a error appears (not enough memory).How can i solve this?

  6. Hi i am trying to create a painttool for terrains.I try it with blendmaps so if there is a green pixel on the blendmap then texture A apears on the terrain,if there is a orange pixels on the blendmap texture b apears on the terrain....The problem are the edges of the textures.So with this methode it only works with three textures (R,G,B) and if i want mor textures it doesnt work :( My source:


  7. Hi i want to save pixelvalues serverside so everybody has every time the same textures (i need this for my terrain shader. The terrain shader works with a kind of blendtexture so white will replace for sand,red for gras ....).But can i save so much informations serverside? 500x500 texture for each object(6400 objects).I dont know the table limit.So my idea was to save it in a string format.

    Is my idea possible or is there a better idea?

  8. Ok thanks :) the only problem is to change the alpha of the outer pixels of the circel so i can use lerp(sand,gras,saturate(1-blendcolor.a)); in the shader so the sandtexture has smoother edges.Have you a solution for that?

  9. So you mean i should use rendertarget and draw a circel on it and give it to the shader?im not a pro in shaders so i dont know which solution is the best.But i need to draw a filled circel.I solve it without sin and cos and use pythagoras.

    function draw (radius,x,y,r,g,b) --x,y the position of the player so the sandtex is drawn under the player 
    local ox,oy,oz = getElementPosition(obj1) --obj1 is the testterrain on which the shader draws the sandtexture 
    nx = (ox+x)*5+250-radius/2 
    ny = (oy-y)*5+250-radius/2 
    local pixels = dxGetTexturePixels (mapdraw) --mapdraw is the empty texture on which i draw the different colors so the shader can replace the colors for different textures  
    for i=0,radius*2,1 do 
    local x = -radius+i 
    local y = math.sqrt(((radius*radius)-(x*x))) 
    for ly=0,y*2,1 do 
    dxSetPixelColor (pixels,nx+x, ny+y-ly, r,g,b, 255) 
    dxSetTexturePixels (mapdraw, pixels) 

    this texture is given to the sahder which replace the white circel with a new sandtexture on a terrain.I hope you understood me :)

  10. Hi i try to draw a circel with dxSetPixelColor for a texture so i can use it for a terrain shader.A recental works fine but when i try to change the colors of pixels in a circel radius >5 it lags ver much :( i select the pixels with math.cos and math. sin.

  11. Hi i want to paint a texture on an other texture.So the texture apears on the other texture in the circel.When i change the position of the circel the texture goes away from the old position.I want that the painting texture keeps on its position and overlay the new position too(like painting).I dont know how to solve this problem(i started with shaders few days ago so i am not a pro) :( Any Tutorials or ideas?

    sampler firstSampler; 
    texture texture1; // drawmaterial 
    float x; 
    float y; 
    float radius; 
    sampler Sampler2 = sampler_state  
    texture   = <texture1>; 
    float4 PSFade(float2 Tex : TEXCOORD0) : COLOR 
        if ( ((Tex.x-x)*(Tex.x-x)+(Tex.y-y)*(Tex.y-y)) < radius )  // Only in circel 
        float4 color = tex2D(Sampler2, Tex); 
        color.rgb = color.rgb*0.5; 
        return color; 
          float4 color = tex2D(firstSampler, Tex); 
           color.rgb = color.rgb*0.5; 
           return color; 
    technique main 
        pass p1   
            PixelShader = compile ps_2_0 PSFade(); 

  12. Hello.I try to check whether a colshape is in a colshape.I guess it does not work with isElementWithinColShape but why?I thought a Colshape is also a element.

    So this is my try:

    function getColshapesElementisin(element) 
    Colshapetable = {} 
        if element or isElement(element)then 
            for i,colshape in ipairs(getElementsByType("colshape"))do 
                if isElementWithinColShape(element,colshape) then 
                    table.insert (Colshapetable, table.getn (Colshapetable)+1,colshape) 
        return Colshapetable 

    Btw You must know that the element must be a Colshape, because i want to use the function to check whether a Colshape is inside another Colshape. Element = Colshape

  • Create New...