Jump to content
The Dark Mod Forums

Wow I Have A Lot Of Questions: Glass


AluminumHaste

Recommended Posts

Can someone take a look at this and tell me why it looks like this in game:

 

textures/mydoom3textures/stainedglass001
{
noSelfShadow
noshadows
twosided
translucent
glass
forceoverlays

qer_editorimage textures/mydoom3textures/stainedglass_edge/stainedglass_edge_d
{
			Program			heatHaze.vfp
			vertexParm			  0	   time * 0 , time * 0 // texture scrolling
			vertexParm			  1	   .4		 // magnitude of the distortion
			fragmentProgram			heatHaze.vfp
			fragmentMap			 0	   _currentRender
			fragmentMap			 1	   textures/sfx/stainedglass_edge_local   // the normal map for distortion			

}
{	
	//maskcolor				
	map			makealpha(textures/mydoom3textures/stainedglass_edge/stainedglass_edge_d)
}	
{
	blend gl_dst_alpha, gl_one
	maskalpha
   		cubeMap		env/gen2
	red		Parm0
		green		Parm1
		blue		Parm2
	texgen		reflect
}	
}

 

It looks like this ingame: shot00034ls3.th.png

 

If I change the material to this:

.
.
.
.
{	
maskcolor				
map			makealpha(textures/mydoom3textures/stainedglass_edge/stainedglass_edge_d)
}
.
.
.

 

It looks like this: shot00035ha5.th.png

 

I'm assuming the maskcolor keyword, gets rid of all the color information, which isn't what I want.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Actually, the maskColor keyword prevents that stage from writing to the color channels. Since your material is translucent, I believe it's intended to have the maskColor keyword enabled. (see below)

 

With maskColor turned on, what's happening is:

  1. The stage with maskColor only writes to the alpha-channel, leaving the existing on-screen picture untouched.
  2. In places where the alpha is high, the next stage adds the color of the cubemap reflection to what's on screen, making it look like some sections of glass are shinier than others.
  3. The heathaze effect is applied, distorting the image. (I've heard that it's applied last, due to accessing _currentrender, but I don't have any firsthand experience with using _currentrender)

With maskColor commented out, what's happening is:

  1. It's missing the maskColor keyword, so the on-screen picture is overwritten with white (because makealpha()'s color channels are always white), and (as before) the correct alpha is written to the alpha channel. Since this stage overwrites what's on the screen, it makes the translucent keyword almost pointless.
  2. In places where the alpha is high, the reflection gets added to the color channels. However, since it's already white on screen and white+color=white, this stage effectively does nothing and everything stays white.
  3. The heathaze fragment shader gets applied. Given that everything is completely white, the effect probably isn't very noticable.

Edit: The id dev site has a good description of what's going on with that texture, as well as descriptions of just about all material keywords and what they do. It's a VERY useful reference when working with materials.

Link to comment
Share on other sites

The id dev sight version of this texture had another stage with "blend filter". That's usually where you would apply color with a map. Since that stage blends by multiplying colors, you probably don't want the map you use to be dark.

 

 

Okay got it, thanks for that link and the info, very appreciated. :)

 

shot00039dx3.th.jpg

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Okay I think I'm getting the hang of this;

 

shot00004nr5.th.jpgshot00003aa2.th.jpgshot00002bz2.th.jpgshot00001qc0.th.jpg

 

Not a bad excercise, I was just making a test in photoshop and playing around with the material script. Seems pretty straighforward now, but I'm not sure you guys need any translucent textures. As all the screenshots I've seen, none of them have windows you can see through.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

There's a good reason for that... D3 doesn't have depth-sorting of translucent materials. The D3 game was pretty careful to design maps and textures such that it wasn't an a huge noticable issue (for example, you usually only saw a single layer of glass, and it was always in a lit area so the cubmapped reflections didn't appear to glow) but in TDM's world such problems would likely be more noticable; there's plenty of windows that are only lit by extinguishable torches (so cubemapped reflections would glow when the torch was extinguished), and such a large number of windows that you could often see one through another (making the lack of depthsorting apparent). Assuming that glitchy windows are to be avoided, the safest thing to do would be to go with opaque ones. (also, opaque windows helps us cut down on what the player can see, increasing performance)

Link to comment
Share on other sites

There's a good reason for that... D3 doesn't have depth-sorting of translucent materials. The D3 game was pretty careful to design maps and textures such that it wasn't an a huge noticable issue (for example, you usually only saw a single layer of glass, and it was always in a lit area so the cubmapped reflections didn't appear to glow) but in TDM's world such problems would likely be more noticable; there's plenty of windows that are only lit by extinguishable torches (so cubemapped reflections would glow when the torch was extinguished), and such a large number of windows that you could often see one through another (making the lack of depthsorting apparent). Assuming that glitchy windows are to be avoided, the safest thing to do would be to go with opaque ones. (also, opaque windows helps us cut down on what the player can see, increasing performance)

 

You could darken the cubemap, which I could do.

 

EDIT: Also, I'd only use these in like a hallway, where you had a hallway seperated by a locked door, and these stained glass windows that you can see through on either side of the doorway. This would add that "I really wanna get in there" syndrome when playing these games, always wanting to see what's behind the locked door.

 

This was done in thief on certain levels, where they used a door with bars in them, but the door was locked.

I like this idea, I'm going to put together a hallway example, it will look neato. :)

 

P.S. this is so much more fun than I thought it would be, I really wanna be a beta mapper/contributer. Although I think that you guys don't really need any more textures.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

We ALWAYS need more textures, you can't have enough. We have very few right now in fact.

 

That's always good to hear, and here's the example I just made...just pretend that there is a locked door there, and at the end of the hallway, there is a table with a nice priceless vase on it. :)

 

shot00008oa2.th.jpgshot00007fa2.th.jpgshot00006az4.th.jpgshot00005fx8.th.jpg

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

P.S. if you guys want a copy of my textures to date, I can host them at fileplanet. They're 100+ MB uncompressed and about 45-50 MB compressed in ZIP format, depending on how far I resize some of the textures. My favorite so far is the moon and stained glass I just made. With this technique I should be able to do some amazing designs. :):)

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Do these textures have normal maps and are they tiling (where appropriate)? We certainly can make use of textures, if they fit our style, but the problem is that we have nobody to work on them, if they need additional processing. You are welcome to contribute though. :)

 

Also yes, I made normal maps (24bit compressed RLE) for all the textures. There are also specular maps, which you don't need to use for some of the textures, which I have omitted from the material file.

 

Some of the older normal maps I made were HUGE, which is why the zip is so big.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Only to be used carefully, in lit areas so that 1 layer only is ever seen of course.

 

Not necessarily, I used a custom environment map (basically almost black) so that when the lights go out, your window doesn't glow so much. Now of course, it's not as bright to look at even when it is lit, but that is just the way it is. I wonder if I apply another stage to texture, a specular stage, maybe that would help brighten it.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

With the glass not drawing behind other glass, just remove the vfp (the wobbly effect) and it will draw all of the glass.

 

That won't solve the problem with ordering though. All of the glass may get drawn, but not necessarily in the right order.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...