Jump to content
The Dark Mod Forums

Using deform sprite (material global keyword)


SteveL

Recommended Posts

I've been testing deform sprite this afternoon. I couldn't find useful info in the forum or the wiki or modwiki, so I'll share my notes here and put it somewhere on the wiki after figuring out the unanswered bits.

 

First up, if what you want to do can be done with particles, I believe you don't need to use deform sprite in the material def: you can use Orientation > View in the particle editor (but I've not tested particles yet).

 

Notes from testing deform sprite:

  • The material won't receive lighting. If you just add "deform sprite" to an existing material def, it'll show up pure black in game. You can fake the lighting by using an opaque or alpha blend and adjust rgb to an appropriate lighting level.
  • Only works with a four-sided surface made of 2 tris. Applying a deform sprite texture to any other surface will result in your "deform sprite" instruction being ignored and an error message every frame in your console.
  • The surface always renders as a square, so use a flat square patch and don't fix subdivisions in the patch inspector. That way it'll look similar in game and in DR. Using a quadrilateral brush face also works, but I can;t think of any situations where that'd be useful... the sprite face becomes detached from the rest of the brush in order to face the player.
  • Rotating the patch in DR has no effect. Stretching it affects the size of the resulting square sprite.
  • Scaling and translating the texture in DR don't affect the output (always renders a square with texture fit 1:1), but you can do those things in the material shader and it works, so I hope you can do it dynamically with shaderparms or globals.

Things I'm not sure about:

  • Should the rgb level be adjustable to ambient light level using the global0/1/2 keywords? I tried that just once but I got a black result, meaning the globals were set to 0 in my test map. How is it done?
  • I guess you might as well delete any bumpmap and specular stages from a material you adapt for a sprite, because there's no lighting so they'll not show up. Is that right?

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.

  • Recent Status Updates

    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 4 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
    • nbohr1more

      Trying to be productive on my down-time before Capcom releases Akuma and my son is constantly on my PC playing Street Fighter...
      · 1 reply
    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 2 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
×
×
  • Create New...