Raised This Month: $12 Target: $400
 3% 

Resizing Decals


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BonzaiRob
Junior Member
Join Date: Mar 2009
Old 02-01-2010 , 08:07   Resizing Decals
Reply With Quote #1

I'm working on a plugin, but it's quite a dedicated one that won't see light of day here; it's making weather effects for a specific map, dm_duel_v2. Now, using various bastardised code (that I would obviously credit if I posted it here), I've got rain and snow falling and the skybox changing. Now I want to put snow on the floor.

So, I'm using some of the built-in textures (materials/nature/snowfloor002a.vmt) as decals and spraying them on the floor, but the textures are 512x512, and dm_duel's floor is, of course, 1213 wide, meaning I have a lovely 200ish gap. If I overlay the decals I get that funky I'm-not-sure-what-decal-I-am-so-I'll-be-both flicker; I don't want to tile them with the overlaps because then I get snow inside.

So, my question is, is it possible to resize decals/vmts on the fly somehow, or am I going to have to manually resize it and make people download it?
I'd be pretty happy with just sizing down to 256 if that's all that's possible, since it would pretty much fill the gaps.

(A second question is, if I put the ApplyDecals code in OnMapStart, they don't show up, I have to trigger them manually. How can I delay the trigger a bit?)

Last edited by BonzaiRob; 02-01-2010 at 08:27.
BonzaiRob is offline
BonzaiRob
Junior Member
Join Date: Mar 2009
Old 02-01-2010 , 10:31   Re: Resizing Decals
Reply With Quote #2

Double post for attachments.

New problem; I made a custom, half-sized (256) vtf. It works the first time it's loaded, but subsequent times I get the white lines shown in the attachments.
It would be purple and black checks if it were missing the texture, surely? :/
Attached Thumbnails
Click image for larger version

Name:	ScreenShot007.jpg
Views:	192
Size:	24.4 KB
ID:	58794   Click image for larger version

Name:	ScreenShot008.jpg
Views:	176
Size:	15.5 KB
ID:	58795  
BonzaiRob is offline
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 02-01-2010 , 17:15   Re: Resizing Decals
Reply With Quote #3

I'm pretty sure the lines refer to some kind of memory error. In my years of mapping I've only seen that happen like one time and all I needed to fix it was a restart.
NatalyaAF is offline
BonzaiRob
Junior Member
Join Date: Mar 2009
Old 02-02-2010 , 16:24   Re: Resizing Decals
Reply With Quote #4

Hm. I have 4GB of memory so there shouldn't be any problems. That's annoying. I suppose it might have been because I'd been going in and out of games and restarting maps a lot to test things, but it's not a very elegant solution anyway.

Ok, so next question: Is it possible to create brushes? Could I create a brush that's the right size and texture it with the snow texture from sourcemod?

If not, I'm going to have to make a model of a square... :/
BonzaiRob is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-03-2010 , 15:24   Re: Resizing Decals
Reply With Quote #5

By any chance is this a linux server?
Dr!fter is offline
BonzaiRob
Junior Member
Join Date: Mar 2009
Old 02-03-2010 , 15:27   Re: Resizing Decals
Reply With Quote #6

No, Win XP, but it is a proper dedicated server. Albeit a stripped down XP.
BonzaiRob is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-03-2010 , 15:32   Re: Resizing Decals
Reply With Quote #7

hmm ok. I just had the white line thing appear on my linux servers with an error in console about precaching. But prior to the recent updates it worked fine. Maybe same in windows? Ill have a look at my windows server and see Im having a feeling valve broke something
Dr!fter is offline
BonzaiRob
Junior Member
Join Date: Mar 2009
Old 02-10-2010 , 10:41   Re: Resizing Decals
Reply With Quote #8

Well, now, I've made a prop of the snow to the right size and it works fine, but the prop only loads properly once; if it gets reloaded, I get the same white lines on the prop.
They seem to follow the polys, but they're not missing textures as I said, because they're black and purple checks.
Could it be I need to uncache the prop before reloading it or something like that? Is that possible? There doesn't seem to be a function for it in the docs.

I have "if(!IsModelPrecached(model)){PrecacheModel(m odel);}", but making it not bother checking (just precaching the model) doesn't work.

So, I have no idea :/
BonzaiRob is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode