Popular Post Obsttorte Posted September 27, 2016 Author Popular Post Report Posted September 27, 2016 FRAGMENT PAINTING Hi everyone. I've spent the last few days trying to find an alternative to vertex painting, a common technique used to blend different textures into each other. The problem is, that it has two downsides:It only works on models it needs additional vertices if you want the blend to become more complexHence I was thinking, whether the blending couldn't be done in the material itself. After some drawbacks I finally found a way to get this to work and wanted to share the current results here. The images are showing the tris, so you can clearly see that no additional vertices are needed. And ... the wall you are looking on is worldspawn Note that this is still vip. Only the diffusemaps are used in this images. I hope you like it anyways. 8 Quote 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
nbohr1more Posted September 27, 2016 Report Posted September 27, 2016 Great work! Custom ARB shader? Quote 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...)
Springheel Posted September 27, 2016 Report Posted September 27, 2016 Very cool! How does that work? Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Bikerdude Posted September 27, 2016 Report Posted September 27, 2016 Very cool! How does that work?+1 Quote
Obsttorte Posted September 27, 2016 Author Report Posted September 27, 2016 Very cool! How does that work?I'll add an explanation here once I'm done fine-tuning it. 1 Quote 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
Popular Post Obsttorte Posted October 1, 2016 Author Popular Post Report Posted October 1, 2016 blend.pk4.txtblend.pk4.txt 5 Quote 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
Goldwell Posted October 1, 2016 Report Posted October 1, 2016 This is fantastic, thanks Obsttorte! Quote Shadows of Northdale Campaign ACT I: A Curious Mind | ACT II: Down The Rabbit Hole Stand Alone Missions Accountant 1: Thieves and Heirs | Accountant 2: New In town | Spring Cleaning | Lord Edgar's Bathhouse | Snowed Inn | Noble Affairs
Obsttorte Posted October 1, 2016 Author Report Posted October 1, 2016 You are welcome:) 2 Quote 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
Bikerdude Posted October 1, 2016 Report Posted October 1, 2016 +3How would I/we make the grass more visible, I would liek to do this when using the stone bump...? how/where would you apply the ambient stage..? how would frob highlight work on this blended texture..? Quote
Obsttorte Posted October 1, 2016 Author Report Posted October 1, 2016 Short answer:You could either use a brighter texture or brighten the image in an image manipulation program. Another way is to alter the shader program and 3. see updated pk4 attachedLong answer : blend.pk4.txtblend.pk4.txt 2 Quote 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
nbohr1more Posted October 2, 2016 Report Posted October 2, 2016 Interesting stuff. Not to be a "Debbie Downer" but it seems that this takes almost as much work as making your own custom texturewith the blend. Also, if I'm not mistaken, you can already mix diffuse stages with a bias image and the "add" keyword: texture_1 = stone, texture_2 = grass, bias_texture = greyscale blend image diffusemap add(add(texture_1, bias_texture),(add(texture_2, invertColor(bias_texture))) so custom arb would not be needed here. Ideally, we would want this to work like a decal where the bias texture would have it's own texture matrix. I suppose you could make a decal that performs the same blend as the above but one of the diffuse textureswould be _currentRender (using something like the heathaze shader).The problem being, of course, specular and bump. You'd need to remove them from the base textures and add them to the decal. Of course, if there were some programmatic way to stretch a bias decal over arbitrary geometry and convert it todiscrete texture scaling values for each surface so that you've got something like: map /bias_texturescale parm1, parm2shear parm3, parm4 and the parm values reorient the bias texture as if it were spanning multiple surfaces, that would be a true replacement for vertex paintingand could also be used for lightmapping (etc). Quote 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...)
Obsttorte Posted October 3, 2016 Author Report Posted October 3, 2016 Interesting stuff. Not to be a "Debbie Downer" but it seems that this takes almost as much work as making your own custom texture with the blend. Also, if I'm not mistaken, you can already mix diffuse stages with a bias image and the "add" keyword:Thanks. Once you have the program writing the material only takes you 5 minutes, if even. I fairly doubt you can create textures that fast. Also, you would blow up the space needed by addding more and more textures. And if you have several variations of how you blend two textures, custom textures for each variation would require more graphics memory and would therefore be more performance-houngry. Funnely, this was the first thing I've tried. However, the add keyword does not seem to work. Using it gives you a warning message and a black texture Do we have any instance, probably in the stock doom 3 materials, where this keyword is actually used. Maybe it was just planned and never implemented.This is the warning you get when using add WARNING:Couldn't load image: add( add( textures/darkmod/stone/brick/blocks_brow n, textures/darkmod/decals/dirt/dripping_slime05), add( textures/darkmod/nature /grass/grass4, invertColor( textures/darkmod/decals/dirt/dripping_slime05))) WARNING:Couldn't load image: add( textures/darkmod/stone/brick/blocks_brown, te xtures/darkmod/decals/dirt/dripping_slime05) The second one is when I only try to use it for two textures. However, even if it would work, as far as I understand the documentation the add keyword was meant to be additive, not multiplikative. (As the name already implies ) 1 Quote 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
nbohr1more Posted October 5, 2016 Report Posted October 5, 2016 Hmm, yeah the additive nature of the keyword will be an issue there I guess, I suppose you might be able to do this instead: diffusemapmap _white blend filter map add(texture_1, bias_texture) // bias texture uses white to mask rather than black blend filtermap add(texture_2, invertColor(bias_texture)) I'll test this one tonight if I get a chance. Quote 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...)
Obsttorte Posted October 5, 2016 Author Report Posted October 5, 2016 You've overread the important part, add doesn't work at all. Quote 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
nbohr1more Posted October 5, 2016 Report Posted October 5, 2016 Even a basic add operation like: diffusemapmap add(textures/darkmod/stone/brick/blocks_brown, textures/darkmod/decals/dirt/dripping_slime05) ? I thought the failure might be due to nesting syntax Quote 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...)
Obsttorte Posted October 5, 2016 Author Report Posted October 5, 2016 Nope, see second warning in post 337. However, the shader is written, using your approach instead wouldn't make it easier anyways. No need to do a lot of digging imho. Quote 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
nbohr1more Posted October 6, 2016 Report Posted October 6, 2016 Argh! I think I know why "add" doesn't work... It seems that image programs don't work on compressed DDS images... Edit: Confirmed. The "add" image program only works with uncompressed textures. Edit 2: (just because of my OCD) Yes, this works with tga: textures/add_two_nbohr1more { { blend diffusemap map _white } { blend filter map add(textures/conny.tga, textures/bias_map.tga) } { blend filter map add(textures/cuckold.tga, invertColor(textures/bias_map.tga)) } } Edit 3: This works to blend the normal maps: { blend bumpmap map addnormals( add( textures/bias_map.tga, textures/darkmod/stone/brick/blocks_brown_local.tga), add( invertColor(textures/bias_map.tga), textures/darkmod/stone/cobblestones/cobblestones_rounded_brown_local.tga) ) } (extra spacing to make all the syntax requirements clear). Full example: two poster textures crossfaded and brick crossfaded with cobblestone: Now the nutzo part of this is that I tried using heightmap to convert the black and white bias texture intoa normal map but it didn't work. I then tried to use scale to make the bias texture blue only but that didn't work.On a lark I then just added the bias texture directly to the normal map and it worked!?!?Then the rest worked according to logic. Cool accident. 4 Quote 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...)
Obsttorte Posted October 6, 2016 Author Report Posted October 6, 2016 Beeing able to blend the normals is definetely an improvement. Thanks for the investigation. It might be worthwhile to check why the code doesn't accept compressed images as arguments for add and see if we can change that. I guess I'll take a look and see if I get an idea of whether it would be possible. In that case I would file a bugtracker. Quote 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
Springheel Posted October 6, 2016 Report Posted October 6, 2016 Won't a blend filter only darken a texture rather than blend them together naturally? Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Obsttorte Posted October 6, 2016 Author Report Posted October 6, 2016 Won't a blend filter only darken a texture rather than blend them together naturally?What are you referring to? Quote 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
nbohr1more Posted October 6, 2016 Report Posted October 6, 2016 That is what I thought too, but what is really happening is: ( source_texture * framebuffer ) + ( framebuffer * 0) So it is only capable of darkening but it the darkening covers the full color range.If you start with a white diffuse map, the darkening is only based on the input of howmuch light strikes the white texture and thus it mimics the way that the regular diffuseimage works. The problem in my diffuse example is that to crossfade the textures with blend filter I had to maskthe unwanted area with white and that masking is unnecessarily brightening the crossfaderegion. I think I can correct that with one more filter stage to counteract it. Probably something like:{ blend filter map add(add(textures/bias_map.tga, invertColor(textures/bias_map.tga)), add(invertColor(textures/conny.tga),invertColor(textures/cuckold.tga))) } Edit: Nope, cannot find a native way to correct the bright band. Had to create a corrective filtertexture in GIMP by flipping a duplicate layer and using darkening then inverting the whole thing: I guess using native functions for diffuse blending is mostly only practical where you don't care about a littlebrightening at the boundary. Obsttorte's shader doesn't suffer that diffuse problem and it works with DDS. So use my operation for bumpmap and Obsttorte's shaderfor diffuse. 2 Quote 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...)
Springheel Posted October 8, 2016 Report Posted October 8, 2016 A while ago I posted an approach to trigger events, if the player was looking at something. I created a scriptobject that can be used for such an approach.trigger_look.script.txtThis scriptobject does allow an entity to trigger it's targets, if it is seen by a specified entity. The term "is seen" does only apply wordly to the player. For other entities (mainly AI) this means they must face the direction (so the z value is ignored). This is because the visibility directions function on them does not work properly. Nevermind. To make it work you just need to copy the above file into your scripts directory and include it with #include "script/trigger_look.script" in your tdm_custom_scripts.script file. Don't forget to delete the .txt ending. In DarkRadiant, if you want an object to react to for example the player looking at it, add the spawnarg "scriptobject" "trigger_look" on it. That's it. If the player is now looking at the object, it will trigger it's targets. The specific behaviour of the object can be controlled by some spawnargs:entityname: the name of the entity to react to (regarding the look direction) (default: player1)stim: the number of the stim that activates the check (default: 23=PLAYER_STIM)distance: the distance between the object to look at and the entity causing the check that should not be exceeded (default:1024)tolerance: the view angle tolerance (default: 0.1), the higher this value, the less precise the entity must be looked atonce: if set to 1, one time use only (default: 0)So without any spawnargs set this entity reacts to the player in a relatively high distance. If you want to use custom stims, they start with 1000 upwards. EDIT: The entity only checks if it is looked at. The real visibility, so if something is in the view between the entity and the viewer, is not checked. Use the distance spawnarg to bypass negative side-effects through this behaviour. If someone needs a version that checks visibility, to, just post here and I will create one. (The same accounts for other stuff may needed). I tried this and got an error: "missing "AI_DEAD" field in script object trigger_look.script" or something to that effect. Does that mean anything to you? (a few more details...put the "scriptobject" spawnarg on an AI, and then targetted him at a gui_message entity I want to play when the player looks at the AI, but loading the map crashes with the above error) Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Obsttorte Posted October 8, 2016 Author Report Posted October 8, 2016 Can you pack up an example and pm it to me so I can take a look? It's hard to tell from the distance. Quote 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
Springheel Posted October 11, 2016 Report Posted October 11, 2016 Can you pack up an example and pm it to me so I can take a look? It's hard to tell from the distance. Try this. It's supposed to trigger the light when you turn to look at the AI, but for me it just crashes on load with a "missing "AI_DEAD" field in script object trigger_look.script" error. http://www.mindplaces.com/look_script.pk4 Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps
Obsttorte Posted October 11, 2016 Author Report Posted October 11, 2016 Ah, you've used it as a scriptobject for the ai. Well, this wont work. The ai already uses a scriptobject, and if you replace it, it wont use the old one and will therefore not work. If you want a reaction when looking at an ai you have to merge the scriptobject of the ai with the trigger_look script. Quote 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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.