Pages: [1]
  Print  
Author Topic: Way to make transparent textures turn solid after a certain distance?  (Read 8235 times)
swizzler
Nub


Cakes 0
Posts: 8


« on: December 09, 2018, 10:22:20 PM »

I'm working on a map for a LAN party, and I am trying to figure out if it's possible to create a shader that is translucent/transparent but goes opaque when viewed from a distance away.

I know this is possible in the source engine with a shader property that is used in window portals, but as far as I could find ioquake doesn't have window portals. (window portals are different than normal portals, they just make the window texture non-transparent at a set distance)


Not final brush/texture work, but this is what I have so far.
« Last Edit: December 09, 2018, 10:32:13 PM by swizzler » Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #1 on: December 10, 2018, 12:44:36 AM »

In shader stages, "alphagen portal"'s suitable for this purpose (used to fade "portals" to white at a distance) but you can use it with non-portals.  You'll still have overdraw probably though.
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
swizzler
Nub


Cakes 0
Posts: 8


« Reply #2 on: December 17, 2018, 05:46:11 PM »

Thanks!

I'm running into another issue now, I'm trying to import a model to work. I got it physically showing up, but it's just showing as pure white. The crazy bit is the editor is seeing the shader fine.

In the video below I've included examples of how my model is set up and where everything is pointed to, I have no idea why this isn't working, I haven't been able to find any guides on how to make mapobject files for OA/Q3 that are still up or don't use a super expensive program like 3DS Max

https://www.youtube.com/watch?v=INY28VlhU10

also I forgot to pull up the shader in the video but here it is.

Code:
models/mapobjects/30deg/venus
{
    q3map_shadeangle 10
{
map $lightmap
rgbGen identity
}
    {
        map models/mapobjects/30deg/venus.tga
blendfunc filter
rgbGen identity
}
}

EDIT: okay, I switched to the blender model exporter recommended in the forum (https://github.com/neumond/blender-md3) and now I'm getting the black and white grid "missing texture" texture. Progress? any way to check why it's failing to load the shader?

EDIT2: Fixed it! for those who trudge down this path after me, I used the blender plugin, set it to use an image texture, but DO NOT SELECT A TEXTURE! just use an empty image named the path to the shader, use the texture in the UV editor to map your UVs, but don't tie it to the model. Also, the model, texture, and shader must be in a PK3, in the baseoa folder, even though the editor sees it, and the game finds the model, the game has trouble finding the shader.
« Last Edit: December 17, 2018, 10:21:51 PM by swizzler » Logged
Pages: [1]
  Print  
 
Jump to: