Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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  
  texturemapping / shading  (Read 1481 times)
0 Members and 1 Guest are viewing this topic.
Offline Olaf

Senior Newbie

Java games rock!

« Posted 2003-10-06 18:29:39 »

hi lwgl-coders !

i'm not a java newbie but just at the beginning of opengl.

nehe-tutorials are great.
i learned a lot. fine !

but now my problem:

i build a textured sphere called "earth".
earth looks right.
after textured sphere
i placed a shaded quad.
if quad is white colored - everythings' ok.
if quad is red or blue colored, "my earth" will be shown
for one moment correctly  - >
and than the earth contours are completly red or blue.

my workaround is to draw a small white quad out of sight.
my earth look well again.

any ideas ?

thanks a lot,
and "good code !"
Offline cfmdobbie

Senior Devvie

Medals: 1

Who, me?

« Reply #1 - Posted 2003-10-06 19:24:29 »

Yep, set the current colour to white before drawing the sphere.

OpenGL doesn't reset any state at the start of your scene rendering, so the last colour you'd used at the end of the previous loop will have still been in effect and been combined with the texture colours in some way (depending on your texture settings).

Hellomynameis Charlie Dobbie.
Offline Mojomonkey

Senior Devvie

ooh ooh eee eeee

« Reply #2 - Posted 2003-10-06 19:25:29 »

Which means you don't have to draw a white quad, just call glColor with white.

Don't send a man to do a monkey's work.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »

Medals: 556
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #3 - Posted 2003-10-06 19:39:31 »

Or turn off texture colour modulation:

Cas Smiley

Offline Mac_Systems

Junior Devvie

I love my Java

« Reply #4 - Posted 2003-10-07 13:10:10 »

Hi  Grin

texture Modulation is also the right trick to do it ?

This strange effect is complete new to me, are there some
more things like this to know ?

- jens

The Network is the Music
Offline Olaf

Senior Newbie

Java games rock!

« Reply #5 - Posted 2003-10-08 06:11:16 »

hi princec !


this glMethod makes my texturemapping look like i want.
but my multicolored grid is white only .

only draw a white-shaded thing at last helped.

Offline princec

« JGO Spiffy Duke »

Medals: 556
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #6 - Posted 2003-10-08 09:00:04 »

You have to turn this feature on when you want to use it, and off when you don't. To modulate the colour of the texture with the current glColor, use

Cas Smiley

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (30 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (22 views)
2015-07-27 15:35:20

Riven (25 views)
2015-07-27 12:26:13

Riven (15 views)
2015-07-27 12:23:39

BurntPizza (37 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!