GU_TFX_BLEND

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
RustyFunkNut
Posts: 17
Joined: Mon Sep 26, 2005 5:10 am
Location: London, UK

GU_TFX_BLEND

Post by RustyFunkNut »

Hiya,

I'm having trouble simulating some of the blending modes for the emulator I'm working on. The GPU of the machine I'm emulating has a very flexible blender, which allows doing things like the following:

Code: Select all

OutColour = EnvColour + VertColour * (TexColour - EnvColour)
(i.e. it interpolates between the environment colour and the vertex colour as the texel ranges from 0..1.

As far as I can tell, GU_TFX_BLEND works something like this:

Code: Select all

OutColour = VertColour + TexColour * (EnvColour - VertColour)
I.e. it interpolates between the vertex colour and the environment colour as the texel ranges from 0..1.

It looks like there are only 5 texture blending modes (MODULATE,DECAL,BLEND,REPLACE and ADD). I was wondering if these were just the "useful" subset of all available blending operations, or whether these are the only blending operations supported by the hardware?

I can simulate many of the available blending modes by using a few tricks (like setting the vertex colour to the environment colour, creating copies of textures with specific RGB components etc), but it looks like some of these blending modes are impossible to simulate accurately with the available sceGuTexFunc modes :(

Any help/suggestions appreciated!

Thanks.
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Re: GU_TFX_BLEND

Post by jsgf »

RustyFunkNut wrote:It looks like there are only 5 texture blending modes (MODULATE,DECAL,BLEND,REPLACE and ADD). I was wondering if these were just the "useful" subset of all available blending operations, or whether these are the only blending operations supported by the hardware?
I think these are all the hardware supports. It's pretty much an implementation of the OpenGL 1.1 texture/blending model, with a few minor extensions.

The lighting model also supports a secondary specular colour which is added to the fragments after texturing, but as far as I know this is only settable by using actual lighting (there's no per-vertex secondary colour). You could also use fog to add a colour term, but I don't know if anyone has worked out the details of how fog works.
RustyFunkNut
Posts: 17
Joined: Mon Sep 26, 2005 5:10 am
Location: London, UK

Post by RustyFunkNut »

Cheers. It looks like I'm just going to have to find a way of working with what what's available. Thinking cap engaged!
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

N64? PSX? :)
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
RustyFunkNut
Posts: 17
Joined: Mon Sep 26, 2005 5:10 am
Location: London, UK

Post by RustyFunkNut »

Maybe :)
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

hello, i am currently working on blend modes
i got the following modes on my todo-list:
# Symmetric blend modes:
average, stamp, overlay, soft light, hard light, interpolation, soft dodge, soft burn
# Non symmetric modes:
reflect, glow, freeze, heat
# Dark blend modes:
multiply, darken, color burn, inverse color burn, subtractive
# Bright blend modes:
screen, lighten, color dodge, inverse color dodge, additive
# Antisymmetric blend modes:
difference, negation, exclusion
# Logical blend modes:
XOR
# RGB blend modes:
Red, green and blue
# HSL blend modes:
Hue, saturation, color and lumniosity
greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Post Reply