Jump to content


Photo

Epi's Many Questions Thread


144 replies to this topic

#51 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 01 February 2016 - 03:31 PM

 

  • I know you can do that with lights, but can it be done with normal materials?

I just tested ("s_shader" on a func_static brush with a custom material) and it does work with normal materials. :smile:


  • Epifire and SteveL like this

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#52 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 833 posts

Posted 01 February 2016 - 05:06 PM

I've created a demo.pk4 with a few examples. This should help you get up to speed...

 

https://onedrive.liv...6625ED3877C9FB4


  • Bikerdude, nbohr1more, RPGista and 1 other like this

#53 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 02 February 2016 - 12:17 AM

1) There are some spark particle effects already defined, so maybe you could adapt those.

 

2) I don't know whether particles can get the sound of the entity that spawned them; under the assumption that they can't, maybe giving the model extra quads using a deform sprite material (to make them always face the camera) would work: something along the lines of textures/darkmod/sfx/fake_haze_02. (Then you'd just skin them as nodraw when the generator's turned off.)

 

There is a deform flare but it seems to be designed around rectangular lights for Doom 3.

 

I may try that with the sparks. Part of me is thinking that I can just do this easier if included within the mesh. As long as I can have working sprites for the glow points on each pylon, I don't see why it can't work as a re-skin instead.

 

I just tested ("s_shader" on a func_static brush with a custom material) and it does work with normal materials. :smile:

 

This makes me happy. Is it possibly you'd have the material to post for that sir?  ;)

 

I've created a demo.pk4 with a few examples. This should help you get up to speed...

 

https://onedrive.liv...6625ED3877C9FB4

 

Your material examples alone help me a ton. I'm understanding why my current version wasn't doing anything after taking a peek at that. I hardly know anything about script or code, so I usually have to find a syntax example to get an idea for how it's implemented. I look at the id4 dev reference stuff a lot, but I feel like that was written for people who actually know what they're looking for.  :wacko:


Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#54 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 02 February 2016 - 11:23 AM

I may try that with the sparks. Part of me is thinking that I can just do this easier if included within the mesh. As long as I can have working sprites for the glow points on each pylon, I don't see why it can't work as a re-skin instead.


In that case, one option to generate the sparks might be a mesh with a deform particle material (see the rain and snow materials for examples). My experience is that particles generated this way can't be lit, but I expect sparks are using blend add or something anyway.

 

This makes me happy. Is it possibly you'd have the material to post for that sir?  ;)

table xtable {{ 0, 1 }}

models/md5/chars/monsters/spider/spider_test
{

qer_editorimage	models/md5/chars/monsters/spider/spider_ed

 noshadows
 flesh

 bumpmap     models/md5/chars/monsters/spider/spider_local
 {
 blend diffusemap
 map models/md5/chars/monsters/spider
 red xtable[sound]
 }
 specularmap models/md5/chars/monsters/spider_s

	// TDM Ambient Method Related 
	{							
		if (global5 == 1)		
		blend add				
		map				models/md5/chars/monsters/spider		
		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/md5/chars/monsters/spider/spider_local			// Bump				
		fragmentMap		2		models/md5/chars/monsters/spider			// Diffuse			
		fragmentMap		3		models/md5/chars/monsters/spider_s			// Specular			
	}

}

(If you actually skin it onto a spider, it does seem to work when the spider gets excited and makes noises. A func_static with something like "s_shader" "activate_airpump_02" and "s_looping" "1" will be nearer what you'll need for the generator; come to think of it I'm not sure quite what entity class you'll be using, given that it needs to be switchable on/off. Lights support skin_lit and skin_unlit spawnargs, but I don't know whether you want the generator to emit any light.)

 

Edit: incidentally, the table is probably redundant in this example, but if you wanted to tone down the effect you could try something like {{0.5,1}} instead.


Edited by VanishedOne, 02 February 2016 - 11:31 AM.

  • Epifire and SteveL like this

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#55 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 02 February 2016 - 10:29 PM

I'm copying loads of material info into my, "Cool Copied Shaders" folder for when I get to use this! I kinda feel like a kid in a candy shop when people give me cool materials.  :wub:

 

One that's bugging me is I've gotten my scroll texture to work in-game but I can't figure for the life of me how to use horizontal scroll. Now I've jumbled this scroll around with different brackets, numbers and stuff I could think of (fore and aft to the time* function) with no effect. Otherwise I just get a vertical scroll instead. Although it still looks pretty cool, it's not what I'm going for since there's some noticeable clipping...

	noshadows
	nonsolid
	twosided


	{
		blend diffusemap
		map      models/darkmod/props/textures/arcBolt_card
		alphatest 0.5
		scroll 0, (time * 1)
	}
	{
		
		blend	add
		
		map      models/darkmod/props/textures/arcBolt_card
		rgb          .8
		scroll 0, (time * 1)
	}

Probably simple fix I'm needing but anything else I try and add before (time * 1) only breaks the material, or does nothing. Otherwise all I want to do after this is get two sprites with some flare at each pylon to blend the start/end a little more. If it's anything to note, they should always render in front of the other alpha planes (to cover the arc bolts). So isn't there a material line to force that in the alpha sorting?

 

EDIT: Still curious about the alpha sorting and sprite stuff, but I fixed the scrolling... well sorta. I figured the thing wanted to vertically scroll instead so I just put a 90 degree flip on my UVs and texture and boom, it works perfectly now. I think adding more stuff might be overkill so for now I think I'm gonna call that good with the arc. I mean most arc bolts I've looked up references on don't have this bloom effect at the pylon source anyway, so it doesn't really pertain to realism either.

 

Additional spark effects would be pretty but I think they would only fit for a special overload mode. Because really unless the unit is damage, it shouldn't spark if working properly right? Either way some interesting thoughts, but maybe for another time. Only other thing I thought would be cool is a working lever. But I figure some kind of mover parent from within DR could handle a separate lever mesh for now. Epi says no to anims right now.  :wacko:


Edited by Epifire, 03 February 2016 - 02:46 AM.

  • Anderson likes this

Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#56 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 03 February 2016 - 10:49 AM

I'd have guessed at scroll time,0 (compare textures/darkmod/decals/symbols/pagan_moving_symbols01), but so long as you've got something that works...

 

I think sorting is controlled by sort <type>, but I don't know the fine details.


Some things I'm repeatedly thinking about...

- louder scream when you're dying


#57 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 04 February 2016 - 01:47 AM

Tried jumbling all of that around. Usually it either was ineffective at altering the scroll state or I'd break the material instead. I don't want to have to do the flip workaround (as it seems kinda shoddy) but it really does do the job if all else fails. I may have to look into that more here on my day off.

 

While I'm still on the subject one other thing has been sticking out while I was doing this. I wanted to get some kind of flare/bloom effect but realized that the alpha for masking is hard edged. Now if I gather correctly, transparency just measures across the whole texture (not taking alpha gradients into account)? Because I wanted to get some kind of flaring effect.

 

I know we also have this light bloom that works on quads but that establishes itself based off the geometry, not the texture I think. Because my initial thought was to pair that onto a sprite (which essentially would be perfect). But the sprite deformer works off of deforming tris, so I think that's invalid when paired with flare. Note when I say sprites, I mean on the pylons not the actual electrical arc. More the contact points.

 

Some annoying constraints but I'm curious as to what other people use for glow methods, besides blend add. It would be wonderful if there could be an additional option to use within blend modes, but I doubt that's no easy feat to accomplish. Because then bloom wouldn't really need to be faked if it could be added dynamically through the material stage.


Edited by Epifire, 04 February 2016 - 01:49 AM.

Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#58 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36020 posts

Posted 04 February 2016 - 08:52 AM

I wouldn't bake glare effects into the model.  Particles are more functional for mappers.  It's very easy to set particles to switchable, so they can be turned on/off by switches or buttons.  It is not so easy to change skins that way.


Posted Image

#59 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 04 February 2016 - 11:09 AM

The original reason I suggested including glare in the model/skin was that Epi wanted to manipulate the shader using the generator's sound.

 

how to create two glow (but rather sharp) start/end flares to help mask the convergence point for the arc to pylon. It would be fantastic if I could give the material a flicker from audio level (as I heard we could do that) since I still have a arc loop snd in the works.

 

I don't know whether particles can get the sound of the entity that spawned them; under the assumption that they can't, maybe giving the model extra quads using a deform sprite material (to make them always face the camera) would work: something along the lines of textures/darkmod/sfx/fake_haze_02. (Then you'd just skin them as nodraw when the generator's turned off.)

 

Regarding soft alpha edges, try blend blend.

 

(Edit: actually, 'entity that spawned them' is ambiguous once you get into def_attach scenarios. I wouldn't be very surprised if it turned out you can put a particle "model" and a sound on a func_emitter and have them work together.)


Edited by VanishedOne, 04 February 2016 - 11:25 AM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#60 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3657 posts

Posted 04 February 2016 - 01:55 PM

What's wrong with blend add? It sounds perfect for getting some glow around an electric arc, if that's what you need.

With blend add, you'd make a black-and-white image in some other app, and then blur it. No need to use the alpha channel (it'll be ignored anyway). In game, the black areas will be unseen, the white areas will be whatever you set the colour to be in the material file, and the grey areas produced by blurring the white arc image will blend in. Blend add is best for things that produce their own light, like a spark.

Blend blend is for transparent materials that produce no light themselves like glass. Their transparency can vary across the surface. The alpha channel says how much of the background colour gets used, and how much of the foreground colour (the transparent surface) is used. Areas with "black" alpha will be pure background, i.e. the transparent surface not visible. White areas on the alpha map will give you pure foreground, i.e. the "transparent" surface will be opaque and 100% visible in those places. 50% grey will give you 50/50. Best used for glass of any type.

Blend filter always darkens the background colour using the colour of the transparent surface, producing a result darker than either. Like Blend Add, the alpha channel is ignored. Best used to modify other effects rather than represent a real world object on its own.

TDM materials do support all the other additive blend options too.. the 3 above are just the common ones with built-in keyword names.

To produce your bloom in a material, I guess you could use the blend add technique plus a shader prog that blurs the white image of the electric arc. I see we do have a few blur shader progs, but I've not tried them. It would probably be easier to just blur the black/white image in Gimp.

#61 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 04 February 2016 - 08:13 PM

The original reason I suggested including glare in the model/skin was that Epi wanted to manipulate the shader using the generator's sound.

 

Yeah, that was the big thing trying to regulate the glow size/intensity. In which case, I'm still slightly foggy as to how I actually setup a material/parent entity relation. I was assuming this was if the mesh was defined as an entity, therefore anything contained in it's definitions could be directed accordingly. In short, I'm using a speaker placed by the prop but I'm not understanding how I get a material within a separate entity to respond to the sound emitted from a different source.

 

What's wrong with blend add? It sounds perfect for getting some glow around an electric arc, if that's what you need.

With blend add, you'd make a black-and-white image in some other app, and then blur it. No need to use the alpha channel (it'll be ignored anyway). In game, the black areas will be unseen, the white areas will be whatever you set the colour to be in the material file, and the grey areas produced by blurring the white arc image will blend in. Blend add is best for things that produce their own light, like a spark.

Blend blend is for transparent materials that produce no light themselves like glass. Their transparency can vary across the surface. The alpha channel says how much of the background colour gets used, and how much of the foreground colour (the transparent surface) is used. Areas with "black" alpha will be pure background, i.e. the transparent surface not visible. White areas on the alpha map will give you pure foreground, i.e. the "transparent" surface will be opaque and 100% visible in those places. 50% grey will give you 50/50. Best used for glass of any type.

Blend filter always darkens the background colour using the colour of the transparent surface, producing a result darker than either. Like Blend Add, the alpha channel is ignored. Best used to modify other effects rather than represent a real world object on its own.

TDM materials do support all the other additive blend options too.. the 3 above are just the common ones with built-in keyword names.

To produce your bloom in a material, I guess you could use the blend add technique plus a shader prog that blurs the white image of the electric arc. I see we do have a few blur shader progs, but I've not tried them. It would probably be easier to just blur the black/white image in Gimp.

 

Oh I have nothing against blend add, I was just under the impression that I couldn't produce a transparent gradient with it. I mean currently my arc bolt is just a hard edged arc, even though the alpha has a soft edge. So what I'm gathering is you can use another image as a mask to the blend add? This shader prog you speak of, it interests me.


Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#62 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 04 February 2016 - 09:19 PM

 

In short, I'm using a speaker placed by the prop but I'm not understanding how I get a material within a separate entity to respond to the sound emitted from a different source.

You can't, but you can put an "s_shader" spawnarg on even a simple func_static and it'll make a sound like a speaker. (Select your entity in DR, right-click in its list of spawnargs, select 'Add property...' and you'll see various available spawnargs, including a Sound directory where you can set looping and so on.) So instead of using a separate speaker, you have a single entity with a model and a sound loop. (Some electric light entity classes are set up like this and use the sound to make the light flicker.)

 

Blend add literally adds the colour in a shader stage to what's already on the screen (clamped at white: RGB 1,1,1), so to get a soft edge with it you need a colour gradient to black (RGB 0,0,0). Black pixels add zero, i.e. no change.


Some things I'm repeatedly thinking about...

- louder scream when you're dying


#63 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 04 February 2016 - 09:49 PM

I think I'm seeing my confusion. The map used for blend add doesn't have to be the diffuse? See I was using the diffuse assuming that had to be layered for it to work.


Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#64 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 719 posts

Posted 04 February 2016 - 10:29 PM

It can be any image map. If you want transparency you don't even need a diffuse map (or bump or specular): just do something like

{
blend add
map <whatever>
}

inside your shader def. and it'll be added to whatever's behind the surface. (It won't interact with lights, though, it'll be fullbright.) See e.g. textures/darkmod/sfx/candleglow


  • Anderson likes this

Some things I'm repeatedly thinking about...

- louder scream when you're dying


#65 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3657 posts

Posted 05 February 2016 - 04:11 PM

Oh I have nothing against blend add, I was just under the impression that I couldn't produce a transparent gradient with it. I mean currently my arc bolt is just a hard edged arc, even though the alpha has a soft edge. So what I'm gathering is you can use another image as a mask to the blend add?

You can produce a soft blend, but you do it all in the rgb channels. The alpha channel is completely ignored for "blend add" material stages, which is why you've had trouble getting it to soften your image.

So:
A black-and-white image, with optional greyscale blurring
A single material stage, as demo'd by VanishedOne above
Optionally, you can add red green blue keywords to that material stage to tint your white image. They default to 1 (full colour) so adding keyword blue 0.5 will reduce the blue channel while leaving the others at full strength and tint your grey-white image yellow.
 
The black parts of your image will add nothing to the background colour, so they will be invisible. The white parts will add the full brightness of your white image, so making a saturated white result. The parts where white is blurring out to black through grey tones will add varying amounts of colour and they'll provide your soft edges. 
 
When I say "background colour" I mean the solid background of your TDM scene, e.g. a wall behind your particle quad or glass pane. It also works with earlier stages of your material, but in your situation we're talking about adding the colour of an electric arc to the solid backdrop formed by the surrounding room.
 
Example material, in full
textures/darkmod/my_map/add_ballburn
{
   {
      blend add
      map textures/decals/ballburn01
      blue 0.5
   }
}
ballburn01 is a simple b/w image with no alpha channel:
Attached File  ballburn01.jpg   3.33KB   0 downloads
 
Here's what it looks like in game, on a patch floating in front of a dark wall:
Attached File  test_2016-02-05_21.04.51.jpg   206.01KB   0 downloads
 
I realise now, ballburn01 doesn't have any truly black parts so the edges of the patch are just about visible.. or at least they were before I compressed the image.
 
Last bit of advice: when tweaking your material def, for colours, scroll speed etc, you don't have to reload. Just alt-tab out of TDM, tweak your material file, then go back into TDM and use console command reloaddecls. That saves a lot of time when experimenting.
  • RPGista, Epifire and Anderson like this

#66 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1350 posts

Posted 06 February 2016 - 02:49 PM

Pretty fascinating, thanks SteveL (and everybody), will surely keep this in mind for my next TDM project (its about HUD models)!



#67 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 07 February 2016 - 12:52 AM

Oh man, so much information! Reloaddecls is gonna help me out a ton as I've been reloading my client before this point, each time I needed to alter my material.

 

Something I've came back to and had some success with today! Went back to my old material def of the Vertex Color blend and am happy to say I have something a bit more workable now. Getting some of the kinks out, and having to use Blender completely this time for painting the vertexes. Only probs I've got now is that it doesn't seem to light correctly, and I'm feeling it may have something to do with how my material is setup. Otherwise we do have proper blending of diffuse and normals going on here...

 

 

 The same material (without vertex paints) is seen on the right. The bottom half of the left is painted black, to blend a dirt and rocks texture.

requiem_2016-02-06_23.45.20_zpsvdgtahoj.

 

EDIT: This is what it looks like with the Lantern. I have to stand and cross angles a couple feet back for it to render...

requiem_2016-02-06_23.56.50_zpsdpnj7mil.

 

If I get close with the lantern I can get it to light at weird angles, but this seems to be, "over-multiplying" somehow. Just much darker and has a hard time lighting and such. Otherwise I'm painting with white and black and it seems to work for the VertexColor / inverseVertexColor lines. Oh and here's the material I'm running it with so far...

terrain_blend_001
{
    	surftype15
    	description "grass"

	noshadows

    {
   	blend bumpmap 
   	map textures/terrain/generic_grass_001_local
	VertexColor
   }

    {
        	blend diffusemap                                                    
        	map textures/terrain/generic_grass_001
        	VertexColor                                                         
    }

    // TDM Ambient Method Related
    {
          if (global5 == 1)
          blend add
          map   textures/terrain/generic_grass_001
          scale 1,1
          red    global2
          green   global3
          blue   global4
          VertexColor
    }



    {
  	blend bumpmap 
	map textures/terrain/generic_soil_001_local
	inverseVertexColor
    }

    {
        	blend diffusemap
       	map textures/terrain/generic_soil_001
        	inverseVertexColor
    }

    // TDM Ambient Method Related
    {         
          if (global5 == 1)
          blend add
          map    textures/terrain/generic_soil_001
          scale 1,1
          red    global2
          green   global3
          blue   global4
          inverseVertexColor
    }
}

Edited by Epifire, 07 February 2016 - 01:00 AM.

  • Anderson likes this

Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#68 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3657 posts

Posted 07 February 2016 - 04:33 AM

Remove the (inverse)vertexcolor keywords from your bumpmap stages. There's not a lot else could be going wrong in that simple material, so that might be it. And a messed up bump map would explain your seeing the colour at only certain odd angles.

 

You don't have to mix bump maps explicitly. What happens is the engine simply uses the last bump map that it saw when it paints a diffuse layer, and then it modulates the overall colour contribution of that diffuse layer by your vertex colour. The order of the stages is important. Each bump map needs to come before the diffuse map that it controls. So your material looks right, except for those keywords. 



#69 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 07 February 2016 - 12:22 PM

Yeah I tried that but no effect. I also tried to manually edit the diffuse inputs to make both 50% brighter to remove any kind of multiply darkening effect that may have. Also removed both bump stages completely if it was a strange overlap issue, as well as trying each in the material individually but no change.  :unsure:

 

I'm convinced it may have something to do with my Blender export procedure as I specifically have to check idtech compatible in the export for this blend to even function at all. Should this matter as to what color I use? Because currently it's just b&w.


Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#70 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3657 posts

Posted 07 February 2016 - 06:27 PM

If you post your simple model that shows this effect, I'll take a look what's going on. It'll probably take me a day or two to get to it, I'm travelling right now. I started to learn Blender last summer myself, and want to get back into it, and I'd be interested in anything that can smooth the workflow between Blender and TDM/DR.

#71 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 08 February 2016 - 12:37 AM

That would be much appreciated! I'll toss the other comparison mesh in for kicks so you can see what a Softimage|XSI exported lwo looks like along side one from blender. Only difference is that the XSI variant isn't painted so it'll come up solid with just the grass texture. All my stuff made in XSI always is required to be re-exported to function correctly in TDM. Sadly I haven't been able to find a fully compatible plugin. But here's the stuff either way!

 

http://www.mediafire...70dvctv5u5rfvw1

 

The nice thing is that doing vert painting is super simple to do in Blender. You basically can hotkey "V" with the mesh selected to toggle the paint mode and export your result. Do note that I haven't been able to get any blending to occur without the, "id tech compatible" box checked.

 

EDIT: After doing some extensive visual testing I've uncovered a little more on how this vertex blending reacts under different lighting scenarios. It actually shows up a lot more evenly when correctly in line with a parallel light. Something to note is that it seems to modulate the coverage almost as if it's lighting through the blend maps. For instance, with an unpainted cube you have even coverage as long as the plane is open and visible to the light. But the painted cube only will receive the majority of light on it's closest corner.

 

I'm also seeing some kind of sheen (almost looks specular?) that shows up at various angles. It's almost as if the vertex color values (or shades in this case) have some kind of contribution to the final lighting step. It's confusing as to what exactly is causing this, but I may try several different things with the vertex colors and see what happens.


Edited by Epifire, 10 February 2016 - 08:57 PM.

Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#72 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 10 February 2016 - 10:14 PM

Well this was worth the bump I think because the results are really promising. I'm not really sure what I did but the big thing is you gotta make sure there's a large light covering the whole thing. Cool thing is there's a red point light showing up fine here too! You can also see that white sheen I was talking about mid way through the path/terrain in the shot below...

 

grass_2016-02-10_21.04.34_zpsbhvccc2n.jp

 

Now this is an extremely simple setup but I have some really solid ideas on how to. "link" textures together to blend multiple materials on a single mesh. Because as long as the primary texture (white painted) is the same, you can swap the secondary and blend nearly anything as long as you give yourself a boarder to blend your primary textures in first. Dug up an old tutorial on this matter as well that may help others with the initial setup of a terrain mesh...

 

http://www.katsbits....d-to-models.php

 

Also on a different (more advanced note) I'm beginning to wonder if we can use opacity masks to further condense what areas are shown for the secondary blend. If and this is a big if, we could then use heightmaps to customize where secondary blends occur. Therefore forcing our texture blend to high or low areas. The possibilities, I r excited!


Edited by Epifire, 10 February 2016 - 10:15 PM.

  • nbohr1more and Anderson like this

Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#73 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3657 posts

Posted 11 February 2016 - 09:39 AM

I've seen the strange specular highlights in my test map. I put 3 spinning cubes side by side, the two models that you supplied plus a third using the dirt texture only. Both textures on the blended model were lit ok, but the corners could be black and at certain angles the specular was really messed up. I'm on holiday in Seville with friends so I've not got round to diagnosing it yet, but I will. It must be a bug in the light interaction shader, very curious.

I think we could do the other stuff you mention by tweaking the interaction shader too. The engine doesn't let you specify a different light shader for different models, but it might be possible to tweak it so that it does its existing thing on most materials but does something different for your custom materials. You'd be limited too using the existing set of input maps though: specular, bump, diffuse. Unlit materials are completely flexible, but lit materials have their setup coded in the engine.

#74 Epifire

Epifire

    Member

  • Member
  • PipPip
  • 299 posts

Posted 12 February 2016 - 04:44 PM

I kinda wanna make a fairly expansive outdoor scene to test this in now. The only other thing I wish we could utilize is parallax shaders. That would be extremely handy for extra terrain depth, but I have some other ideas that may help handle that. What's really awesome about this method is that there are really no harsh UV seams anywhere. Like as long as you setup your tiling to really match the playable space, you can also bend and warp the terrain a bit to fit even more. For instance, you could easily setup a brick path and blend it to a thin dirt line. Then you'd use another material that blends from dirt to grass. So theoretically there's no limit to the blending as long as you have additional materials to separate each planned area. There's noticeable tiling as we see, so another one we could use is a separate grass to weeds/shrub (whichever) and intersperse them in patches.

 

One that really intrigues me is being able to not have bland transitions from separate models, such as rocks. I could make patches of rocks, posts, walls or fences that have neatly minded transitions. So instead of props simply clipping into terrain we could see them as something that actually looks like it belongs in the environment. 


  • Springheel likes this

Needing dem environment models?


Speak to the EPI!


Or rummage my online mesh repository instead...  https://www.mediafire.com/folder/7q1r8him1y63d/TDM%20Repository


#75 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 833 posts

Posted 12 February 2016 - 08:08 PM

I was watching a GDC talk this morning about the vfx in Diablo 3 and one thing mentioned reminded me of this thread. Around 20 minutes in the speaker talks about an additive blend that makes use of an alpha channel and demonstrates the difference.

 

I think we can do this already without any fragment programs.

 

{
  blend gl_one, gl_one_minus_src_alpha
  map textures/glowyshit
}

 

The whole talk is worth watching but this was the only thing I thought was immediately applicable to TDM.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users