Jump to content
The Dark Mod Forums

Recommended Posts

Posted

That's right. We already have some nice glass that fakes refraction by using a simple low res cubemap. The difference from real refractions is not noticeable under most circumstances.

 

sorry Merry for the branching, as soon as someone posts something usable I promise to start a new thread

  • Like 1
Posted

 

Ignore the depth problems... We can have nice glass that works well in 99% of settings without having to solve those problems, and mappers can avoid the other 1% of settings. You know better than anyone else what the best is out there :) What's on offer? We can use GLSL shaders for transparent surfaces and/or different blend modes without any major engine changes.

 

The last time I checked, the best glass shader was still the old rthdribl demo:

 

 

https://dl.dropboxusercontent.com/u/17706561/rthdribl_1_2.zip

 

If you're looking for out-there stuff, it seems some Russian has done a pretty nifty caustics demo:

 

http://translate.google.com/translate?hl=en&ie=UTF8&langpair=auto|en&rurl=translate.google.com&tbb=1&u=http://www.uraldev.ru/articles/id/39/page/2

 

but I haven't found a good example of what Springheel is looking for "milky glass"...

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted

It's not about making them milky, it's about making the glass look like it's actually solid glass. This is the hourglass glass texture applied to a bottle model. I don't find that convincing at all--it looks like a ghost bottle rather than real glass. You almost can't see them in the second shot. There's also no sense of shape--they appear completely flat.

post-9-0-13149700-1432522401_thumb.jpg

Posted

Those screenshots don't look glass like because you're only handling refraction while reflection is virtually absent. I'm not sure if this is addressable via the current build of the engine but I can say that you need a dynamic cubemap that can be referenced via material shader.

 

You need to be able to reference an image map like _scratch but this image needs to be an average of cubemaps compiled based on neighboring info_location entities. Half-live 2 does something like this. Each location has a cubemap associated with it. As you approach one or the other the neighboring environment maps are weighted into an average. If you get really fancy you can even apply parallax effects to make the reflection appear more true to life.

 

The only downside to this approach is the cubemap is static. If you turn lights on/off that status will not be reflected in the cubemap. No Ai will be reflected. No effects. No nothing. You could probably account for this but it would incur a performance penalty. All in all it's good enough without those extra details but we could add them as time marches forward.

Posted

Looks like only the outside of the bottle has geometry. It needs an inside layer too. A really bright specular map might help too.

 

Half life way worked fine because you couldn't turn out the lights :D

Posted

It's not about making them milky, it's about making the glass look like it's actually solid glass. This is the hourglass glass texture applied to a bottle model. I don't find that convincing at all--it looks like a ghost bottle rather than real glass. You almost can't see them in the second shot. There's also no sense of shape--they appear completely flat.

 

Our current glass shader is a post-process effect that ignores the shape of the object. It just distorts what's behind a bit to let the viewer know there's slightly warped glass in the way, and adds a bit of colour. It works well enough for flat glass panes, but it fails completely on curved surfaces, and it has no concept of thickness or multiple layers. Your pics show the problem well. It looks like bottle shapes have been cut out of a flat pane of glass.

 

I'm wondering how to represent the changing thickness of the bottle so it looks like a rounded bottle and not a flat cut-out of a boittle.

 

Ray tracing to get it right is obviously out of reach for a game engine.

 

Rich's suggestion of an environmental cube map for each location is probably the only way we could get the blue light of the sea coming through the upper surface of the bottle like you see in the original picture. We have a cheapy version of that in our current glass shaders. It uses the same grey cubemap for every pane but it does look very effective when used right.

 

Shadows and caustics are another matter. They need to affect surfaces other than the bottle itself, so they can't be done in the glass shader and would definitely need engine support. The shadow experiments we've been messing with for 2.04 would lend themselves to modelling semi-transparent shadows and caustics. In the experimental branch, we've replaced the on/off shadow stencil for each light with an alpha mask that can hold other values and attentuates the light effect. Caustics could be done quite accurately as anti-shadows: areas of "shadow" that intensify rather than decrease the light effect.

 

To start with, let's think about what we can do through the glass shader alone.

Posted

@Obsttorte: nice one! That's rather exciting. It means I have something new to go and study about how light interactions are drawn. I thought I knew that you couldn't have both light and transparency (other than 50% screen-door-style translucency) because light interactions are drawn only where the scene depth equals the depth buffer. Clearly not right. I wonder if that's how Arcturus' water ripples get to reflect light too?

Posted

It was the first thing that came to my mind. More of a wild guess, to be honest. But it worked out pretty well :)

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

  • 2 months later...
Posted (edited)

This'll be very useful :) (though merrypainting35 is a duplicate of carravagio1 apart from the frame, merrypainting08 is incorrectly declared in the .mtr as a duplicate of merrypainting06, merrypainting21(, _m, _l) is declared twice in the .mtr, and merrypainting09 is declared twice in the .skin).

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

Thanks!

This'll be very useful :) (though merrypainting35 is a duplicate of carravagio1 apart from the frame, merrypainting08 is incorrectly declared in the .mtr as a duplicate of merrypainting06, merrypainting21(, _m, _l) is declared twice in the .mtr, and merrypainting09 is declared twice in the .skin).

Thanks Hawkeye! I'm here to talk to you about the Avengers Initiative now that I've fixed all that.

  • Like 1
Posted

Added a bunch of custom paintings to the OP!

It's amazing!

"I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

Posted

Sorry about this, but I've more painting trouble to report.

post-35144-0-27791000-1439742493.jpgpost-35144-0-90102800-1439742515.jpgpost-35144-0-02889600-1439742525.jpgpost-35144-0-61483300-1439742534.jpgpost-35144-0-66012900-1439743344.jpg

I suspect the problem in the second and fourth images (which occurs when Ambient Rendering is set to Simple) is coming from the use of models/darkmod/props/textures/painting03_d, though I haven't tested.

 {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         models/darkmod/props/textures/painting03_d
        rgb         0.15 * parm11
    }

	// TDM Ambient Method Related 
	{							
		if (global5 == 1)		
		blend add				
		map				models/darkmod/props/textures/painting03_d		
		scale			1, 1		
		red				global2	
		green			global3	
		blue			global4	
	}							
	{							
		if (global5 == 2)		
		blend add				
		program	ambientEnvironment.vfp	
		vertexParm		0		1, 1, 1, 1		// UV Scales for Diffuse and Bump	
		vertexParm		1		1, 1, 1, 1	// (X,Y) UV Scale for specular		
		vertexParm		2		global2, global3, global4, 1	
																
		fragmentMap		0		cubeMap env/gen1				
		fragmentMap		1		models/darkmod/props/textures/painting01_local			// Bump				
		fragmentMap		2		models/darkmod/props/textures/painting03_d			// Diffuse			
		fragmentMap		3		models/darkmod/props/textures/painting01_s			// Specular			
	}
}

The first, third and fifth images' missing textures I think are due to paintings from 48 onwards including only _l and _m image files, e.g. merrypainting48_d.tga doesn't exist, and the console reports being unable to load it. (Though my screenshots actually use the models/darkmod/decorative/wall/painting01_l.lwo model. Weirdly, I also got different results - 1st and 3rd vs. 5th image- depending on whether I unpacked the files.) Again, I haven't actually tested this.

 

Also, I found another error in the skin file: it has merrypainting50l instead of merrypainting50_l.

 

Have a nice day.

 

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

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

    • Ansome

      While updating my first FM, I noticed a lot of silly things I did because I was still new to DR. For example, there was a model for a wheel that I wanted the player to be able to turn that had its origin off-center. I didn't know I could just re-export the model inside DR to fix its origin, so instead that wheel triggers a func_mover it's bound to. A silly solution in retrospect, has anyone else made somewhat janky or roundabout solutions to technical challenges in their maps? I'd love to hear about 'em!
      · 5 replies
    • datiswous

      If you use DarkRadiant in Linux while using a dark theme, a large amount of the icons are hard to see, because it's dark-color on dark background (wish DR darkmode was a little less dark). A workaround is switching to a light theme when using DR. I'm using XFCE as DE, so I made this script (mostly copied from this code), which works as a toggle. Then I set it to a keyboard shortcut. The switch works even when DR is already opened.
      current_theme=$(xfconf-query -c xfwm4 -p /general/theme) if [[ $current_theme == 'Adwaita-dark' ]]; then xfconf-query -c xsettings -p /Net/ThemeName -s 'Mint-X-Grey' xfconf-query -c xfwm4 -p /general/theme -s 'Mint-X-Grey' else xfconf-query -c xsettings -p /Net/ThemeName -s 'Adwaita-dark' xfconf-query -c xfwm4 -p /general/theme -s 'Adwaita-dark' fi This only works for the XFCE DE though.
      · 0 replies
    • datiswous

      I just bought/build a new pc, so probably less performance related whining from my part from now on..
      Sorry in advance!
      Here are the specs
      · 4 replies
    • jivo

      In case you missed it, I updated the Visible Player Hands mod to version 2.0. It now works while a weapon is selected and has a Linux version too.
      Check it out if you're interested: Visible Player Hands 2.0
      · 0 replies
    • thebigh

      Starting a playthrough of the whole Dark Mod, from oldest mission to newest. I've knocked over the first few already and about to start Living Expenses. Only ~170 missions to go!
      · 12 replies
×
×
  • Create New...