Destinations

Destinations

VincentJones Jun 12, 2016 @ 10:47am
Creating a Sprite in Source 2 (.vmat)
Hey there guys. I'm working on a project and unfortunately I realized that I cannot for the life of me figure out how to create a sprite material within Source 2. I took a look at the .vmat file and it's laid out very differently than a VMT so I assume the method of sprite creation for Source 1 does not apply. I tried simply applying a .vmat to an env_sprite but that doesn't appear to have any success.
< >
Showing 1-11 of 11 comments
Ṭoyoka Jun 12, 2016 @ 1:41pm 
Several things to take note; the process for creating and placing a sprite/particle in the map is a bit technical. Creating a vtex that is used for texturing particles also takes a few steps to do but should be relatively easy. You'll also need Notepad ++[notepad-plus-plus.org] to make one.

First, the source texture you are using should be in .tga format. If it isn't, convert it into a .tga format with any program that is available to you. It should also be placed somewhere within your addon's content/steamtours_addons/MY_ADDON_NAME/materials directory

Next, open up Notepad ++ and create a new file. Save it immediately with the same name as your .tga file, but with the .vtex extension (ie. mytexture.vtex) and in the same directory as the .tga.

Now, copy the code at the bottom of this post.

Replace "materials/texture_directory/mytexture.tga" with the directory and name of your texture (ie. "materials/particle/my_particle_texture.tga").

Save and close the file. The texture should appear in your asset browser after you restart the tools and search for it!

----------------------

See this wiki entry on how to create a simple particle in the workshop tools (this entry is for Dota 2, but the particle editor tool is identical to the one in Destinations, so it should be easy to follow).

Once you're done creating your particle, you want to place an info_particle_system entity in your map where you want the particle to appear. This takes the place of env_sprite, which is a deprecated legacy Source 1/GoldSource entity.

----------------------

Code to copy into your .vtex (formatting of the code breaks this post, which is why it's at the bottom. Sorry!):

<!-- dmx encoding keyvalues2_noids 1 format vtex 1 --> "CDmeVtex" { "m_inputTextureArray" "element_array" [ "CDmeInputTexture" { "m_name" "string" "0" "m_fileName" "string" "materials/texture_directory/mytexture.tga" "m_colorSpace" "string" "srgb" "m_typeString" "string" "2D" } ] "m_outputTypeString" "string" "2D" "m_outputFormat" "string" "DXT5" "m_textureOutputChannelArray" "element_array" [ "CDmeTextureOutputChannel" { "m_inputTextureArray" "string_array" [ "0" ] "m_srcChannels" "string" "rgba" "m_dstChannels" "string" "rgba" "m_mipAlgorithm" "CDmeImageProcessor" { "m_algorithm" "string" "" "m_stringArg" "string" "" "m_vFloat4Arg" "vector4" "0 0 0 0" } "m_outputColorSpace" "string" "srgb" } ] }
Last edited by Ṭoyoka; Jun 12, 2016 @ 2:09pm
VincentJones Jun 12, 2016 @ 2:20pm 
You are the absolute best. Bloody hell that's a perfectly followable post.

I already have notepad++ since a million things require it, so this should be no problem to follow.

I assumed that env_sprite was still used since it's chilling around in Hammer2's list. Now, my final question is this: what changes need to be made to this sprite so that it will not always aim at the player, but follow along a axis instead?

The specific situation here is remaking the trees from Mario 64. They rotate to face the player while remaining locked to the world.
Ṭoyoka Jun 12, 2016 @ 2:48pm 
No problem!

Yea, unfortunately a lot of old entities still remain in the Source 2 tools. This makes it hard and sometimes confusing for people who have transitioned from Source 1 Hammer (or even those new to the Source/Source 2 engine in general) to find what entities still work and which ones don't. Pretty much any entity that does anything related to sprites or effects are unusable (ie. env_sprite, env_beam, env_smoke, etc.), and we substitute this with the info_particle_system (and create our own particles in the particle editor) instead :)

Concerning the tree sprite, you will have a bit of trouble replicating the billboard effect as seen in the original game.

The closest you can get is to set the particle orientiation type to "World-Z Align" in the "Render sprites" renderer, and give it two "Rotation random" initializers. One for Roll and one for Yaw. One of these should have their offset min and max set to 90 (to orient the sprite into the right rotation) and the other should be left at 0 and 360 for min and max respectively, to create a pseudo-billboard sprite that isn't exactly flat, but also not exactly 3D either.
Last edited by Ṭoyoka; Jun 12, 2016 @ 2:50pm
VincentJones Jun 12, 2016 @ 2:52pm 
Thanks a lot! I'll try to remember that a lot of things are obsolete and hope I can stumble around until I find the replacments!
Ṭoyoka Jun 12, 2016 @ 3:00pm 
Good luck! Some time ago, I had compiled a small list of entities I thought would have been useful for mapping in Dota 2 but these turned out to be broken. Many of the same deprecated entities remain in both Dota 2's workshop tools and in Destinations. These may or may not have changed up until now.
Last edited by Ṭoyoka; Jun 12, 2016 @ 3:07pm
VincentJones Jun 12, 2016 @ 5:16pm 
Originally posted by Ṭoyoka:
Good luck! Some time ago, I had compiled a small list of entities I thought would have been useful for mapping in Dota 2 but these turned out to be broken. Many of the same deprecated entities remain in both Dota 2's workshop tools and in Destinations. These may or may not have changed up until now.


Hey, I haven't gotten started yet so maybe it's something simple in the particle editor, but how would I go about also including an alpha map for my sprite?
Ṭoyoka Jun 13, 2016 @ 12:58pm 
Sure thing. The alpha map should be made within the source .tga file. You can add an alpha channel in most paint-type programs (GIMP has this, if you want to use something free) and use it to block out what parts of the texture should be transparent or not. I believe black designates where the texture is transparent and white, of course, is the opaque part of the texture.
Last edited by Ṭoyoka; Jun 13, 2016 @ 12:58pm
VincentJones Jun 13, 2016 @ 4:16pm 
Originally posted by Ṭoyoka:
Sure thing. The alpha map should be made within the source .tga file. You can add an alpha channel in most paint-type programs (GIMP has this, if you want to use something free) and use it to block out what parts of the texture should be transparent or not. I believe black designates where the texture is transparent and white, of course, is the opaque part of the texture.
Oh holy crap. I totally forgot about including alpha maps within one file. I had all of my alpha maps as seperate pictures that I was designating as such within the material editor.
Jim_Partridge Jul 31, 2016 @ 7:26am 
Can i change the color of my sprite in the particle editor or does that need to be done in the .tga image file?
Rectus Jul 31, 2016 @ 11:40am 
Originally posted by Jim_Partridge:
Can i change the color of my sprite in the particle editor or does that need to be done in the .tga image file?

The "Color lit per particle" and "Color Random" initailizers can be used to change the color in the editor.
Ṭoyoka Jul 31, 2016 @ 1:54pm 
You can change the particle color in the base properties. You should generally use greyscale particle images if you want to easily recolor them.
< >
Showing 1-11 of 11 comments
Per page: 1530 50