Portal: Stay Inside is a third-party addition to VALVe's game Portal 2. Taking place in the familiar Aperture Science facility at an unspecified point in time, the mod may veer away a little from the franchise's canon but will stay within believable bounds. The mod is expected to have roughly four main areas covering the game's clean, destroyed, and early testing environments. A primary focus for me as the developer is to create an engaging storyline with enjoyable and asthetically satisfying chambers and environments. I am considering making the mod episodic, depending on how development proceeds, but in any case it is currently still under heavy development and closed beta testing. There is currently no expected release date. Stay tuned for more information!

Report article RSS Feed How to Recolor Portals (DX9 and Above)

Several people have asked how I modified the portals in Portal: Stay Inside so that not only the portal itself but also the surrounding particle effect is a different color. In this tutorial, I explain some of the basics of skinning and particle system work for DX9 and above portals.

Posted by WinstonSmith on Apr 1st, 2010
Intermediate Skinning.

How do you change the color of portals?

This is a question that has been asked of me a few times recently, so to provide not only an answer but a guide for future reference, I thought I'd write up a tutorial about it. In addition to explaining how to modify the portals themselves, I'll be giving a little bit of information about some of the under-the-hood workings of the Source engine. Please feel free to add comments, PM me, etc.; all feedback is welcome!

What are Portals?

Whenever you're modifying something--especially with the Source engine--it helps to understand what you're modifying. Portals are made of a few different components. There is the code aspect of the portal, which handles the movement of the player from one location to the other, the physics surrounding the portal, etc. Without the next two components, however, portals would simply be a hole in the wall. What surrounds the portal and produces the swirly effect (with the help of the last component) is a regular model, basically similar to a prop that you'd place. In fact, the name of the entity to place an AI-controlled portal is prop_portal. The model, however, would be invisible if it weren't for the texture that covers it. The final item that makes up a portal is a particle system. This generates the "swirling mist" effect in front of the portal and also handles the various "fizzle" effects. In this tutorial, we'll be modifying the texture and the particle system.

Step 1: Editing the Textures

Alright, a little more background on the textures first. There are two sets of textures for portals: one is used on machines that are running DirectX 8 or below graphics, and one (more detailed) is used on machines running DirectX 9 or higher. If you're simply changing your portals for your own enjoyment, you only have to modify the textures for your system. However, if you're distributing the modified portals in a mappack (see note at bottom of tutorial) or a Sourcemod, you should edit both sets to ensure everyone sees your fine work. Since I'm still trying to figure out how to modify the DX8 textures, we'll only cover the DX9 textures in this tutorial.
Down to business. Download a copy of VTFEdit if you don't already have it installed and navigate to "portal content.gcf" this file will reside, most often, in C:/Program Files/Steam/steamapps/. Once you've opened the GCF, find /portal/materials/models/portals/ and extract the files

--portal-blue-color.vtf
--portal-orange-color.vtf

to the same directory for your project. By this I mean extract it to C:/Program Files/Steam/steamapps//portal/portal/materials/models/portals/ if you're making a mappack and C:/Program Files/Steam/steamapps/sourcemods/{mod_name_here}/materials/models/portals/ if you're making a mod. Now open up the textures in your favorite image editing application. Look at the textures. They're 1 pixel tall and 256 pixels wide. The left side appears black (or possibly transparent), and the right side appears blue (or orange). You can do pretty much whatever you want, as long as the texture stays 256x1 pixels, but there are a few rules to keep in mind if you want your portals to look like VALVE's. First, the texture isn't actually black; the black represents transparency. So to change the color of the portals and have them look similar to VALVE's, create a 256px wide by 1px tall gradient that is completely transparent on the far left side and completely opaqe with whatever color you desire on the far right side. Save these as VTFs using whatever method you choose. If you've worked with the Source engine already, you will already have done this, because the first thing you learn in Source work is that you must save every twenty seconds to be safe.

Step 2: Editing the Particles

Now we're going to work a bit with particle systems (the mist and such around portals). First, extract "portals.pcf" from "portal content.gcf/portal/particles/" into the particles directory of Portal or your mod. To run the built-in particle editor that comes with Source games, add "-tools"--without the quotes-- to the end of the target of the shortcut for either Portal or your mod. Now run the shortcut, and when the game launches, you'll see something like

The Source particle editor.

Now click File-->Open--> and navigate to the place where you extracted portals.pfc. Open it. There are several particle subsystems. Click on one of them, and it will open; it will look something like this.

An opened particle subsystem.

Basically, go through all of the subsystems and find color values that are either blue or orange. They're green in the above screenshot because I've opened the edited particle system for Portal: Stay Inside. These correspond to the blue/orange mists surrounding the portals, and you can change them to whatever you want. Once you're done, click File-->Save and you can close the editor.

Finished Results

Here's an example of finished results; these are the portals being used in Portal:Stay Inside.

An example of finished recolored portals.

Wrapping Up

Well, that's just about it! I'll explain a bit about why I haven't done anything for DX8 portals. First, I apologize to those who are running DX8 systems for not covering it, but I'm still working on figuring out the textures. They're harder to modify than the DX9 ones, because they appear to have two different facets. In any case, the good news is that the process of modifying the DX8 particles is identical to the DX9 ones; just use portals_dx80.pcf instead of portals.pcf. If I can solve the DX8 texture issue, I'll certainly edit this tutorial. Good luck with modding and thanks for reading!

Best regards,
WinstonSmith

Post comment Comments
Colossal
Colossal Apr 2 2010, 7:36pm says:

Very cool.

+2 votes     reply to comment
sbrown
sbrown Apr 2 2010, 9:48pm says:

That right there is ******* awesome. Whens stay inside released? Do you need more help?

+1 vote     reply to comment
WinstonSmith Author
WinstonSmith Apr 2 2010, 10:12pm replied:

When will it be released? No clue. Certainly after Portal 2, and even then, I haven't the slightest. It's still in fairly early alpha stage. Right now I think I've got a fairly good handle on it, but thanks for the offer.

+1 vote   reply to comment
fadi.naoum.
fadi.naoum. Apr 3 2010, 10:10am says:

THANKS BUT HOW DID U CHANGE THE GLOW

0 votes     reply to comment
WinstonSmith Author
WinstonSmith Apr 4 2010, 2:46pm replied:

Which glow are you referring to?

+1 vote   reply to comment
theyoungster
theyoungster Sep 24 2010, 4:41pm replied:

i'm assuming the blue and orange glows that appear on the portalgun.

+2 votes     reply to comment
Centaur1um
Centaur1um Apr 7 2010, 10:02am says:

I recolored them to be the same color.

+2 votes     reply to comment
UnLeAsHeD-LoRd-
UnLeAsHeD-LoRd- Apr 14 2010, 2:51pm says:

Very good mate well done!

+1 vote     reply to comment
cpw1
cpw1 Apr 16 2010, 8:02pm says:

My favorite editing application doesn't know how to open the files for some reason. Can you help me out?

+1 vote     reply to comment
cpw1
cpw1 Apr 16 2010, 8:06pm says:

Oh, yeah one last thing. My email is Quotedconman@hotmail.com

+1 vote     reply to comment
ShagoR
ShagoR May 3 2010, 12:06pm says:

Hi,

im able to change the particles,

but not the whole portal, can u advise where to save them?

many
thx

+1 vote     reply to comment
BrettMatt
BrettMatt Jun 7 2010, 6:49pm says:

Hey,

When i change the color of the portal i keep one side black and make one side completly opaqe with the color i want but when i go into the game its black. No matter what color i put its black, and when i try to change the color of the particles no matter what color i make the edge or vaccume it stays its original color. Please help.

Thanks for your help

+1 vote     reply to comment
Heliophobe
Heliophobe Jul 3 2010, 11:02pm says:

Where do I add the "-tools" part? I tried in the shortcut extension, and in the file path. Both didn't work.

+1 vote     reply to comment
Heliophobe
Heliophobe Jul 3 2010, 11:08pm replied:

never mind, I got it....

0 votes     reply to comment
Groxkiller585
Groxkiller585 Jan 12 2011, 7:22pm says:

I cannot edit the portals, because the PCF does not have any color values. (exept one but it is both the wrong color and has no effect on the portals) help?

+1 vote     reply to comment
Wheatley 
Wheatley  Apr 29 2011, 11:57am replied:

After editing anything with tools mode, the system disables the content you just edited. You need to restart the game (quit then re-open game) to see the results.

+1 vote     reply to comment
Crawfishness
Crawfishness Oct 27 2011, 10:43am says:

Can I get some help? I can't edit the portal_projectiles.pcf! Every time I edit it, it just reverts back to it's original state when I close it and re-open it!

+1 vote     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Portal 2 Icon
Platform
Windows
Game
Portal 2
Developed By
WinstonSmith
Contact
Send Message
Official Page
Winston-smith.org
Release Date
TBD
Mod Watch
Track this mod
Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Mods
Portal: Stay Inside (Portal 2)
Portal: Stay Inside Portal 2 - Single Player Puzzle Compilation
Related Games
Portal
Portal Single Player Puzzle Compilation