@Ellis: Cockpit Transparent Textures

Posted by Madman271 
@Ellis: Cockpit Transparent Textures
Date: June 14, 2003 09:20AM
Posted by: Madman271
this is facts that i found regarding to your question about cockpit view mode's transparent texture. my answers is possible with some exceptions so far. what i've been found is the facts that gp4 using z-buffer technique for rendering transparent texture. this is doesn't mean you just simply adjust the alpha part of the texture because z-buffer technique using alpha part of diffuse color from the material for this purpose. z-buffer also require alpha blending should be enabled during render stage.

for clarity, i try to describe how gp4 works to rendering transparent texture for 3d shapes. first, gp4 detect any shapes with material's diffuse alpha value is 1.000 (opaque), then render the shapes. second, gp4 detect any shapes with material's diffuse alpha value is less than 1.000 (non-opaque), then render the shapes. the code logic is similar like this:

--- code ---
// enable alpha blending for current render stage
set alphablend true

// render any opaque objects
for loop = 1 to numobjects
begin
if (object[loop].material.diffuse.alpha = 1.0000)
then render(object[loop].mesh)
end

// render any non-opaque objects
for loop = 1 to numobjects
begin
if (object[loop].material.diffuse.alpha < 1.0000)
then render(object[loop].mesh)
end

// disable alpha blending
set alphablend false
--- code ---

the code logic above commonly used in directx programming to render any shapes which contains opaque and transparent objects. unfortunately, i found a fact that .gp4 format does not store alpha part of diffuse color in material properties. the alpha part for diffuse color is assigned from within the gp4 codes. this is a code logic i found in gp4 codes which modify the material properties for z_cockpit_visor object for all car shapes:

--- code ---
if (object[loop].name = 'z_cockpit_visor';) then
begin
object[loop].material.diffuse.red = 1.0000
object[loop].material.diffuse.green = 1.0000
object[loop].material.diffuse.blue = 1.0000
object[loop].material.diffuse.alpha = 0.3000
end
--- code ---

i refer to z_cockpit_visor object because this is one of car shape's object that i know produce transparent texture while rendering. now i hope you understand why transparent texture is so difficult to produce by just changing any values in .gp4 file. the transparency part in material also does not affect to car shapes (it is perhaps for track shapes).

now we talk about the possibilities for applying transparent texture to any shapes. earlier in this topic i said "possible with some exceptions". i experimenting in .gp4 file for car shapes by swapping 'z_cockpit_visor' object name with another, i.e. 'upper_rear_wing' object name. this produce the upper rear wing shape becoming transparent with a small shade (but the texture seems changed). i realize the cockpit visor is still transparent but no shade anymore just completely 100% transparent (this effect must be seen toward car direction). this result make me think that transparent texture is possible to be applied but i don't know if it just produce 100% transparent or we can control the amount of shade from texture's alpha part. i'm sure this is not just limited to car shapes but must also be done with cockpit shapes.

and one thing that could be important. gp4 always using 'visorspecmap.tex' texture to combine the way z-buffer produce transparent shape during alpha blending stage. if i remove this texture assignment from 'z_cockpit_visor' object (from within gp4 codes) then cockpit visor rendered as 100% opaque texture.

in other thread you were said about transparent driver's view helmet visor. this visor can be viewable transparent by adjusting the alpha part of the texture because helmet visor is not part of 3d shapes. helmet visor is simply 2d sprite texture drawn by directdraw engine, not by direct3d engine. controlling transparent texture in sprite texture is far easier than in 3d environment. however, too many sprites drawn on your screen my drops your PO.

and here some terms in this topic that perhaps you or anyone does not perfectly clear. z-buffer is special buffer controlled by 3d engine (in this subject refer to directx and graphics driver) to emulate depth of 3d environment mapped to 2d monitor screen. cockpit visor is a small windshield located near steering-wheel. another terms i've been used is beyond the scope of this topic, but feel free to ask.

ps;
if i found some new interesting, i'll inform you to this forum.



ch88rs,
madman




In reality, doesn't matter who's right but most important is who's left.
Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 09:31AM
Posted by: tux
again, great work :) :) :)

but ellis is at lemans atm, so ill say a big thank you for him ;)





Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 09:37AM
Posted by: sasjag
lol, considering i'm working with ellis on this

Tnx :)



Sim


All Hail The New York Giants - Winners of Superbowl XXI, XXV and XLII!

"I'd love to know what goes on in that crazy head of yours sometimes, Sim..." - Locke Cole
Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 09:39AM
Posted by: tux
Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 12:31PM
Posted by: Lo2k
as usual: impressive !



Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 02:51PM
Posted by: Caelen
ive read what youve written madman and understood about half, just as a addition, incase you didnt know. there is another shape in gp4 that allows transparency through alpha channel. that is the steering wheel and dashboard. i proved this by making my window in the dash board file and creating it under one of the warning objects already in the dash. the alpha channel controlls the opaqueness. black for totally clear and white for opaque and all shades in between give different levels of see-throughness.
(the black,white could be reversed, cant remenber exactly)
Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 03:02PM
Posted by: Madman271
thanks for the info, caelen.

i refer to z_cockpit_visor because this is 'true' shape with complex polygons. steer and dash is actually flat polygon (directx called it as plane). this is 2d shape rendered as 3d shape (much like billboarding technique), and doesn't require z-buffer technique to render such shapes.

i think ellis ask about transparent texture because he concerning to apply windshields into his GTA project. well, i just assuming... :)


ch88rs,
madman
Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 03:40PM
Posted by: Lo2k
Another 3D shape using transparency is helmet visor.
I also tweaked the .gp4 file and get a full transparency helmet (as the visor is usually)
About this, i also discovered that helmet visors also received a color per team from the GP4 file but i havn't search for the exact adress...



Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 05:11PM
Posted by: erwin_78
don't forget the spokes in the wheel shape. That object really is alpha depended for transparency.
Disadvantage of the wheels and helmet is that they are both moving and separate from the car itself.
As far as i have expierenced only the is fixed with a damage model. Helmet and wheels seem not to matter with object amount and names...



WYSIWYG / F1: Overtaking has become a strategy!
Re: @Ellis: Cockpit Transparent Textures
Date: June 14, 2003 05:19PM
Posted by: Caelen
you could be right madman but the window i used in my cockpit is a 3d shape, it is not just a single plane, it has depth and is made of many polygons.
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 06:37AM
Posted by: sasjag
*bump*


jus in case u missed this ellis ;)



Sim


All Hail The New York Giants - Winners of Superbowl XXI, XXV and XLII!

"I'd love to know what goes on in that crazy head of yours sometimes, Sim..." - Locke Cole
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 09:17AM
Posted by: shutt1e
@Madman

i know that glasses made with z_cockpit_visor are transparent in the game but unfortunately this object was removed from lods greater than 0
if i leave this object in my carshape with lod>0 it is just ignored and rendered as standard textured object when gp4 uses a lod >0
you know a way to block this?
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 12:11PM
Posted by: Madman271
To Shuttle:
This is has been discussed somewhere in newer thread. But I can give you two possible suggestions:

First, you can simply replace the LOD >0 of the shape file (.gp4) with the LOD 0 version of the shape file. E.g. replacing car_ferrari_1_lod_1.gp4 with car_ferrari_1_lod_0.gp4 file.

Second, this not been tested yet but in my opinion it might works. You can add z_cockpit_visor object name in the shape file. I don't know if ZModeler or similar .gp4 file editor can do such purpose.


ch88rs,
Madman
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 12:16PM
Posted by: sasjag
i tried that and it doesn't work madman, i guarantee it :(



Sim


All Hail The New York Giants - Winners of Superbowl XXI, XXV and XLII!

"I'd love to know what goes on in that crazy head of yours sometimes, Sim..." - Locke Cole
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 12:21PM
Posted by: Madman271
Which one? Or both of them?


ch88rs,
Madman
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 12:34PM
Posted by: Ellis
i seen ur post madman, do not fully understand it, but it is a step forward, will read it again later, bit busy (working out who does what in our project - theres a hell of alot of work)




Racing Is Life. Anything that happens before or after is just waiting
Jesus may be able to heal the sick and bring the dead back to life, but he can't do shît for low fps
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 04:17PM
Posted by: shutt1e
@madman

both your suggestion does not work

z_cockpit_visor object lost its properties with lod >0 i.e. no trasparency

if you want, take a look at this screeshot of an early beta of my carset

[it.geocities.com]

the car behind me uses lod_0 and the car behind him a lod >1,as you can see the second car has non trasparent glass

all carshapes in this screenshot uses all glasses mapped on the z_cockpit_visor and this object is present in all cars lod.

thanks.
Re: @Ellis: Cockpit Transparent Textures
Date: June 18, 2003 04:21PM
Posted by: sasjag
yes, z_cockpit_visor becomes opague in any LOD below 0 for no reason



Sim


All Hail The New York Giants - Winners of Superbowl XXI, XXV and XLII!

"I'd love to know what goes on in that crazy head of yours sometimes, Sim..." - Locke Cole
Re: @Ellis: Cockpit Transparent Textures
Date: June 19, 2003 01:57AM
Posted by: shutt1e
yeah sasjag a reason exist!

lods >0 uses 24 objects only and z_***** obejcts are removed from cashapes.
you can add it on carshape lods 1/2/3/4 but the gp4 3d engine use them as standard textured objects.
i've made LOTS of experiments with various textures and various objects that in other 3d objects are transparent,like helmet visor,steering whell etc. including them in to the carshape but all of them lost it's charateristics. I.E. you can have a transparent helmet visor in the helmet shape that uses the visorspecmap.tex but if you create an object in the carshape named visor and that use the same texture it become opaque in the game.

i think a mod in the exe is needed.

@madman

did you think to include in a future version of gp4tweaker a patch for having only 20 or less car running?
i can have actually how many cars i want in the game using some tricks but only using hot seat, so i need to drive more than one car
Re: @Ellis: Cockpit Transparent Textures
Date: June 19, 2003 08:55AM
Posted by: Madman271
To Shuttle and Sasjag:
The best solution is I should (again) looking forward to GP4.exe codes. :)
I'll posted a thread if some interesting info found.

Shuttle, cars number patch is one of the hardest things to change in GP4. This is due to how GP4 codes work with number of cars for loopings, conditionals, etc. I was working on it months ago and still doesn't found any good results. Hope this is solved soon or later. btw, nice screenshot. From GTA mod?


ch88rs,
Madman
Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, TomMK, Noog, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy