Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Very cool! How does that work?

I'll add an explanation here once I'm done fine-tuning it.

  • Like 1

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

Posted

+3

  1. How would I/we make the grass more visible, I would liek to do this when using the stone bump...?
  2. how/where would you apply the ambient stage..?
  3. how would frob highlight work on this blended texture..?
Posted

Short answer:

  1. You could either use a brighter texture or brighten the image in an image manipulation program. Another way is to alter the shader program
  2. and 3. see updated pk4 attached

Long answer :) :

 

 

blend.pk4.txt

blend.pk4.txt

  • Like 2

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

Posted

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:

 

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 textures

would 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 to

discrete texture scaling values for each surface so that you've got something like:

 

map /bias_texture

scale parm1, parm2

shear 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 painting

and could also be used for lightmapping (etc).

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
  1. Interesting stuff.
  2. 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.
  3. Also, if I'm not mistaken, you can already mix diffuse stages with a bias image and the "add" keyword:
  1. Thanks.
  2. 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.
  3. 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 ;) )

  • Like 1

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

Posted

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:

 

diffusemap

map _white

 

blend filter

 

map add(texture_1, bias_texture) // bias texture uses white to mask rather than black

 

blend filter

map add(texture_2, invertColor(bias_texture))

 

I'll test this one tonight if I get a chance.

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

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.

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

Posted

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:

 

post-3763-0-65347100-1475723282_thumb.jpg

 

 

Now the nutzo part of this is that I tried using heightmap to convert the black and white bias texture into

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

  • Like 4

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

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

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

Posted

Won't a blend filter only darken a texture rather than blend them together naturally?

What are you referring to?

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

Posted

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 how

much light strikes the white texture and thus it mimics the way that the regular diffuse

image works.

 

The problem in my diffuse example is that to crossfade the textures with blend filter I had to mask

the unwanted area with white and that masking is unnecessarily brightening the crossfade

region. 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 filter

texture in GIMP by flipping a duplicate layer and using darkening then inverting the whole thing:

 

post-3763-0-73466700-1475807170_thumb.jpg

 

I guess using native functions for diffuse blending is mostly only practical where you don't care about a little

brightening 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 shader

for diffuse.

  • Like 2

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

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.

attachicon.giftrigger_look.script.txt

This 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 at
  • once: 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)

Posted

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.

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

Posted

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

Posted

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.

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

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

    • jivo

      I just uploaded a new version of the Visible Player Hands mod. It's been updated for TDM 2.13 and has new animations. Check out the post if you're interested!
      · 0 replies
    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 5 replies
×
×
  • Create New...