Shaders,. . passing a bitmap?

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Shaders,. . passing a bitmap?

Post by jph_wacheski »

I was working on learning more about how the shaders function and what we can do with them in ZGE, and have some questions,. .

With the current implementation can a shader link to more bitmaps than the single one selected in the material?

I was trying to get an enviro-map working however I am not sure I can use a cubemap,. ? This ability would be usefull for many things, like haveing a texture, and a bumpmap, or alphamap, etc. However it apears to me that the material is what determines the bitmap the shader can access,. is this correct?

also i attached the closest I have come to getting a nice crome effect with out a texture,. looks more like shinny plastic perhaps,. . just for interest.
Attachments
base_shader_000.zgeproj
sample of a texture shader,. .
(1.62 KiB) Downloaded 421 times
shader_plastic_005.zip
shinny plastic shader demo.
(39.34 KiB) Downloaded 423 times
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

That plastic shader looks really nice. And the model has originated from one of Kjells functions right?

You are right, the shader can only access the material texture (afaik) so we are going to need Texture2 and Texture3 properties on material in ZGE. I've made a note of this and hope to fix it for a release soon.
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi guys,

Extra texture slots would be desirable for normal maps and such indeed.

Chrome is all about high reflection, low diffuse / specularity. Unfortunately, to pull this off best ( especially with objects that self-reflect ), you need to render a reflection map ( dynamically or pre-rendered ).

Here are some screenshots of a quick attempt in ZGE. I'll share the shader once I'm done tweaking.

K
Attachments
Chrome.jpg
Chrome.jpg (115.33 KiB) Viewed 4969 times
Post Reply