Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 36 Guests
Online:

LATEST FORUM THREADS

»
Gaming
Q4 General
eXtreme+ v2.9
CoDBO Map + Mod Releases
map loading error
CoD2 MP Mapping
Good Servers on PC
CoDBO General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Quake 4
Category: Q4 Scripting
Scripting and Coding for Quake 4
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Shader scripting
geshp
General Member
Since: Feb 11, 2005
Posts: 16
Last: Nov 4, 2006
[view latest posts]
Level 1
Category: Q4 Scripting
Posted: Saturday, Nov. 4, 2006 01:48 pm
I'm trying to make a shader for the startup screen. The tga graphic is 1024x1024 and I'd like to have it spinning from the center and visible only once. In order to make this look right, I have to scale it 1.414x (or .707 times per screen) with a tcmod scale .707 .707 command. When I do this, the texture starts in the upper-left corner instead of being centered. Does anyone know how to realign the graphic so the texture's center is center-screen?

quitmenuback
{
nopicmip
nomipmaps

{
map textures/effects/tunnel.tga
blendFunc GL_ONE GL_ZERO
tcmod scale .707 .707
tcmod rotate 45
}
}

Share |
foyleman
Preferred PLUS Member
Since: Nov 6, 2001
Posts: 95759
Last: Oct 31, 2018
[view latest posts]
Level 10
Admin
Forum Moderator
Im a fan of MODSonair
Im a HOST of MODSonair
Category: Q4 Scripting
Posted: Monday, Nov. 6, 2006 06:24 pm
I am not a shader expert, but maybe this will help:
Quote:
6.5 tcGen
Specifies how texture coordinates are generated and where they come from. Valid functions are base, lightmap and environment.

= base texture coordinates from the original art.
= lightmap texture coordinates
= Make this object environment mapped.

6.5.1 tcGen vector ( ) ( )
New texcoord generation by world projection. This allows you to project a
texture onto a surface in a fixed way, regardless of its orientation.

S coordinates correspond to the "x" coordinates on the texture itself.
T coordinates correspond to the "y" coordinates on the texture itself.

The measurements are in game units.

Example: tcGen vector (0.01 0 0) (0 0.01 0)
This would project a texture with a repeat every 100 units across the X/Y plane.


Taken from: http://www.heppler.com/shader/
Go ahead... You Play I Mod : Support Modsonline by becoming a PREFERRED MEMBER today!
Have you heard the MODSonair Podcast?:
MODSonair is a weekly podcast bringing you the news from a modders perspective.
Tune in every Sunday at 12pm EST to listen LIVE.
Quake 4 Mods for Dummies - Half-Life 2 Mods for Dummies
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Quake 4 : Q4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»