Jump to content
The Dark Mod Forums

Magnanimous Merry's Miscellanea


Airship Ballet
 Share

Recommended Posts

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
Link to comment
Share on other sites

 

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...)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

You mean adding an inside to them? Yes, it would be interesting to see what happens there.

Link to comment
Share on other sites

I've uploaded kitchen/wine_bottlle_clear. Feel free to experiment with it. Right now it is textured with bc_flaskglass, which doesn't quite work.

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

badge?user=andarson

Link to comment
Share on other sites

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

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.

 Share


  • Recent Status Updates

    • duzenko

      CPU benchmark time - compiling DarkRadiant (2nd run)
      i5 8600K 6C/6T@4.4GHz DDR4 2x2133MHz 9MB cache
      Parallel builds: 1. 3:57 Parallel builds: 6 (default). 2:28 r5 1600AF 6C/12T@3.3GHz DDR4 1x2666MHz 16 MB cache, temp folder on HDD
      Parallel builds: 1. 5:05 Parallel builds: 4. 2:47 Parallel builds: 6. 2:55 Parallel builds: 12 (default). 2:57
      · 2 replies
    • nbohr1more

      Status updates are back so it is also a good time to return to contests!
      https://forums.thedarkmod.com/index.php?/topic/21095-christmas-connections-contest-2021
       
      · 0 replies
    • freyk

      Having seen the new scifi stuff from bladeghost/scythwraith, want to continue the cyberpunk project. Only one problem, can't map.
      · 1 reply
    • jaxa

      Behold, the brand new RTX 2060!
      NVIDIA ponders GeForce RTX 2060 re-release with 12 GB VRAM to paper over RTX 30 scarcity
      · 1 reply
    • thebigh

      There are those who are afraid of greatness
      · 2 replies
×
×
  • Create New...