Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Accessing GL_LUMINANCE_ALPHA32F_ARB texture with Shader  (Read 1815 times)
0 Members and 1 Guest are viewing this topic.
Offline AI Guy

Senior Newbie





« Posted 2008-02-05 22:51:35 »

I have a fully functional set of 3 textures, and a fragment shader with functions that access the textures and return structures, to effective have a database.

What I am concerned with is that one of them is comprised of 2 element, 32 bit float, texels. I access it like:

vec4 texel = texture2DRect(sampler_nm, addr);

What happens is texel[0], texel[1], & texel[2] all have the value of the first element that went in.  texel[3] has the value of the second element.  This sort of scares me.  I was hoping the first 2 elements would have the values, and [2] & [3] either be the next texel or be garbage.

This is occurring on a GeForce 8800 GTX/PCI/SSE2 renderer, but compiled using the ARB version of shaders.  How thin is the ice I am on, in terms of portability?  Should I redesign?  Does anyone know what 3 element texels do?
Online Riven
« League of Dukes »

JGO Overlord


Medals: 783
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2008-02-05 23:02:51 »

It's a few years ago that I worked with greyscale textures, but I'm fairly sure this is normal behaviour.

In the 'old times' with fixed-pipelines, the texture-multiplies must have had values in the G and B, or else:
RGB1 * L2
would have resulted in
R1*L2, G1*0, B1*0.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Chris61182

Junior Member





« Reply #2 - Posted 2008-02-05 23:04:24 »

Don't worry, everything is working just like it should be. If I'm not mistaken, the behavior should correspond to Table 3.20 in the OpenGL spec....

Alpha Texture = {0, 0, 0, A};
Luminance Texture = {L, L, L, 1};
LuminanceAlpha Texture = {L, L, L, A};
Intensity Texture = {I, I, I, I};
RGB Texture = {R, G, B, 1};
RGBA Texture = {R, G, B, A};
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline AI Guy

Senior Newbie





« Reply #3 - Posted 2008-02-06 19:55:13 »

Thanks,

It makes sense that the luminance, the first element, would be spread across the 3 colors & and the alpha, the second element, would be in the alpha.  What a shock.

I find it easiest to specify vec4's as arrays rather than a color structure, because my data has nothing to do with color.  I need to take it more into account that color is the reason for OpenGL in the first place.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (13 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (31 views)
2014-08-16 06:45:27

Tekkerue (30 views)
2014-08-16 06:22:17

Tekkerue (19 views)
2014-08-16 06:20:21

Tekkerue (29 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (42 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!