• render.drawquad not rendering everyframe
    6 replies, posted
as the toic indicates the name indicates [url=http://wiki.garrysmod.com/page/render/DrawQuad]render.DrawQuad[/url] dosen't render the material quad everyframe. ive tried different 3d functions, they gave me the same results. anyone please? <3 [sp]i feel so stupid about this post x)[/sp] [video=youtube;FMWVxahWHMA]https://www.youtube.com/watch?v=FMWVxahWHMA&feature=youtu.be[/video] [code] local mat3 = Material( "phoenix_storms/wood" ) function drawMaterial(pos,size,material) render.SetMaterial( material ) render.DrawQuad( pos+Vector(0,0,0), pos+Vector(0,size,0), pos+Vector(size,size,0), pos+Vector(size,0,0), Color( 255, 255, 255 ) ) end hook.Add( "PostDrawOpaqueRenderables", "test", function() for x=0,7 do for y=0,7 do --drawMaterial(Vector(-256+(y*64),-256+(x*64),10.1),64, mat3) --render.SetLightmapTexture( mat3:GetTexture() ) drawMaterial(Vector(0, 0, 0)+Vector(y*64,x*64,0),64, mat3) end end end ) [/code]
Pretty sure you are using the wrong shader for this. You must be using UnlitGeneric, not VertexLitGeneric.
[QUOTE=Robotboy655;51215708]Pretty sure you are using the wrong shader for this. You must be using UnlitGeneric, not VertexLitGeneric.[/QUOTE] tried this, dosen't work i am doing it client side, however i am not sure if the material is a .png file as the wiki says "Only works with .png files, and only clientside" [code] local mat3 = Material( "phoenix_storms/wood", "unlitgeneric" ) [/code]
that's not how it works. You need to create a whole new material.
i just went to download gcfscape and found the file this it what it says. .. so i don't think that not using "VertexLitGeneric" is the problem [code] "VertexLitGeneric" { "$basetexture" "phoenix_storms/wood" "$surfaceprop" "metal" "$bumpmap" "phoenix_storms/wood_bump" "$envmap" "env_cubemap" "$normalmapalphaenvmapmask" 1 //"$basealphaenvmapmask" 1 "$envmapcontrast" 1 "$envmapsaturation" 1 "$envmaptint" "[ .3 .3 .3 ]" "$model" 1 "$halflambert" 1 } [/code]
Yes, what it says is "VertexLitGeneric". What you want is "UnlitGeneric".
oh fuck my bad, btw just found a pic on google then made a material with VTFEdit this works aswell :O [code] "LightmappedGeneric" { "$basetexture" "unicorn/wood" } [/code]
Sorry, you need to Log In to post a reply to this thread.