AshuraDX Posted May 20, 2013 Share Posted May 20, 2013 Hey there everybody , I basically have the following problem : I got to apply an environment map to parts of a texture I cant use overlays in this case so is there any way to maks an environment map ? Link to comment
mrwonko Posted May 20, 2013 Share Posted May 20, 2013 Could you elaborate some more about what your result is supposed to look like? Having an overlay is the simplest way of achieving this, but depending on how this is to be used (e.g. a grate?), depthFunc equal could work as well. Link to comment
Pande Posted May 20, 2013 Share Posted May 20, 2013 This is something I just recently learned myself and haven't tested, but read this: AlphaFunc: Determines the alpha test function used when rendering this map. Valid values are GT0, LT128, and GE128. These correspond to "GREATER THAN 0", "LESS THAN 128", and "GREATER THAN OR EQUAL TO 128". This function is used when determining if a pixel should be written to the framebuffer. For example, if GT0 is specified, the only the portions of the texture map with corresponding alpha values greater than zero will be written to the framebuffer. By default alpha testing is disabled. Both alpha testing and normal alpha blending can be used to get textures that have see-through parts. The difference is that alphaFunc is an all-or-nothing test, while blending smoothly blends between opaque and translucent at pixel edges. Alpha test can also be used with depthwrite, allowing other effects to be conditionally layered on top of just the opaque pixels by setting depthFunc to equal. So, in theory, this shader should work. Please anyone correct me if I'm wrong, it's untested. textures/mapname/shadername{qer_editorimage textures/mapname/texturenamesurfaceparm trans{map textures/mapname/alpha_maskalphaFunc GE128depthWrite}{map textures/mapname/envtcGen environmentdepthFunc equal}{map $lightmapblendfunc filterdepthFunc equal}} So, you need two images: your env map, and an alpha map (.tga with white objects in it, no transparent pixels) Link to comment
AshuraDX Posted May 20, 2013 Author Share Posted May 20, 2013 okay will paly around with thisI want to achieve a glossy oil puddle decal for an efx file so I can scrap the lightmap I guessEDIT: I got this , and it doesn'T look like it's working in ShaderED2... gfx/newfx/puddle_decal { surfaceparm trans polygonOffset q3map_nolightmap { map gfx/newfx/puddle_mask alphaFunc GE128 depthWrite } { map gfx/newfx/puddle blendFunc GL_ONE GL_ZERO depthFunc equal rgbGen lightingDiffuse tcMod scroll -0.05 0 } { map gfx/newfx/puddle_env blendFunc GL_ONE GL_ONE depthFunc equal glow tcGen environment } } Link to comment
Szico VII Posted May 21, 2013 Share Posted May 21, 2013 What you really want is a way to get blendfund blend working with an envmap and no mask image.. 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