Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

D

Multiple coloured layers / textures

This topic is 5931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This should be a simple question to all those DirectX guru''s out there. I''m in the midst of creating my directx based backend for my engine, and I have already completed my Opengl one. It is all based on a simple surface scripting language (aka shaders), and it supports layers - which are loosely deemed to be rendering passes. In these layers you can assign colour values from the surface, internal engine colour array, a constant colour, or some other function that generates a colour. Now in opengl this was simple to render, just make an array of the necessary size and pass it to the rendering API through the glColorPointer function. But in directX I can only seem to be able to specify only one colour array or one colour value per point / vertex. And thus my rendering loop would have to assign colour values replcing the existing one''s in the Vertex buffer each iteration through the main rendering loop (i.e. where I used to put glColorPointer). Now one way that I see to do this in DX is to omit the color info from the Vertexbuffer, and instead specify a material each time. So the loop would be: (OpenGL) for each layer in surface setcolour[layer] settexture[layer] setvertecies setnormals ... etc drawelements (directx) setstream settexture setmaterial is this the only way? or does anyone know a funkier way of doing more than one colour in the whole surface by say using either pixel or vertex shaders? Dæmin (Dominik Grabiec) dominik.grabiec@student.adelaide.edu.au

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!