Jump to content


Photo

Magnanimous Merry's Miscellanea


172 replies to this topic

#51 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 24 May 2015 - 06:32 PM

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


  • Airship Ballet likes this

#52 Airship Ballet

Airship Ballet

    Advanced Member

  • Member
  • PipPipPip
  • 1490 posts

Posted 24 May 2015 - 07:58 PM

super don't mind.



#53 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7646 posts

Posted 24 May 2015 - 09:09 PM

 

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.dropboxus...thdribl_1_2.zip

 

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

 

http://translate.goo...es/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.c...ds/the-dark-mod

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

#54 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36372 posts

Posted 24 May 2015 - 09:53 PM

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.

Attached Files



#55 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 856 posts

Posted 24 May 2015 - 10:56 PM

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.



#56 Gestas

Gestas

    Member

  • Member
  • PipPip
  • 65 posts

Posted 25 May 2015 - 02:40 AM

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



#57 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 25 May 2015 - 05:08 AM

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.



#58 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5080 posts

Posted 25 May 2015 - 05:52 AM

*
POPULAR

You need to give the glass texture a bumpmap.

 

Attached File  elevator_2015-05-25_12.49.27.jpg   563.02KB   1 downloads

 

The bottle on the right uses the texture textures/darkmod/glass/clear_warp, as used by the hourglass and in Springheels shots above. The left one uses a custom texture, which is the same as clear_warp but with this line added:

bumpmap _flat

This allows the light to interact with the surface and gives a suitable representation of the geometrical shape.


  • Springheel, Bikerdude, Dragofer and 3 others like this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#59 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 25 May 2015 - 08:48 AM

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



#60 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5080 posts

Posted 25 May 2015 - 01:41 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#61 Gestas

Gestas

    Member

  • Member
  • PipPip
  • 65 posts

Posted 25 May 2015 - 02:50 PM

looks much better but still needs inside geo.



#62 Tudor

Tudor

    Member

  • Member
  • PipPip
  • 78 posts

Posted 28 May 2015 - 09:30 AM

Displacement or refraction or what you want to call it tends to come with some depth issues, how would a couple of these on a shelf look?



#63 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18536 posts

Posted 28 May 2015 - 09:36 AM

looks much better but still needs inside geo.

@Springheel, could you make some bottle models and then use Obs method so we can see what it looks like..?



#64 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36372 posts

Posted 28 May 2015 - 09:43 AM

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


  • Bikerdude likes this

#65 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36372 posts

Posted 30 May 2015 - 08:26 AM

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.



#66 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 18536 posts

Posted 30 May 2015 - 09:37 AM

ta.



#67 Airship Ballet

Airship Ballet

    Advanced Member

  • Member
  • PipPipPip
  • 1490 posts

Posted 15 August 2015 - 01:28 AM

Added a bunch of custom paintings to the OP!


  • Goldwell, Anderson and SteveL like this

#68 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 15 August 2015 - 08:26 AM

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, 15 August 2015 - 09:01 AM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#69 Gast

Gast

    Member

  • Member
  • PipPip
  • 104 posts

Posted 15 August 2015 - 09:17 AM

Very impressive assets and audio here, nice job.



#70 Airship Ballet

Airship Ballet

    Advanced Member

  • Member
  • PipPipPip
  • 1490 posts

Posted 15 August 2015 - 10:20 AM

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. 


  • Anderson likes this

#71 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 777 posts

Posted 15 August 2015 - 12:17 PM

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.

 


#72 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11787 posts

Posted 15 August 2015 - 12:37 PM

My Lord, where was I back in April? Just stumbled across this thread. Maybe too deep in doing taxes.

 

Absolutely marvelous stuff, Merry! Thanks!



#73 Dunedain19

Dunedain19

    Member

  • Member
  • PipPip
  • 211 posts

Posted 15 August 2015 - 11:22 PM

The new paintings are wonderful!



#74 Airship Ballet

Airship Ballet

    Advanced Member

  • Member
  • PipPipPip
  • 1490 posts

Posted 16 August 2015 - 03:43 AM

Thanks guys!

 

I call this one Lacklustre Still Life

 

08667ec04f.jpg

(big food dump coming some time in September)


  • RPGista and Anderson like this

#75 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 16 August 2015 - 12:02 PM

Sorry about this, but I've more painting trouble to report.
 
Attached File  err1.jpg   24.08KB   0 downloadsAttached File  err2.jpg   25.07KB   0 downloadsAttached File  err3.jpg   34.33KB   0 downloadsAttached File  err4.jpg   37.92KB   0 downloadsAttached File  err5.jpg   22.13KB   0 downloads
 
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




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users