Jump to content
  • Advertisement
Sign in to follow this  
eq

Point sprites + pixel shaders? [SOLVED]

This topic is 4812 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

How to combine these? More specific, how do I read a texture in the pixel shader? (Where's the texture cordinate?) Edit:
ps_2_0

dcl_2d  	s3
dcl		v0
texld		r3, ??, s3 ; <= How?
mov		r0, v1 
mov		oC0, r0


[Edited by - eq on June 17, 2005 8:27:37 AM]

Share this post


Link to post
Share on other sites
Advertisement
I'm no expert when it comes to assembled shaders but having gone thru some of the code I think you could try:

ps_2_0

dcl_2d s3
dcl v0
dcl t0.xy
texld r3, t0, s3
mov r0, v1
mov oC0, r0


On a sidenote, why aren't you using CG or HLSL? It's much more friendly to code with!

HTH!

Share this post


Link to post
Share on other sites
That does indeed sample from the texture, however it seems like t0 is always (0, 0) over the whole sprite (the same for all t? registers).
So all I get is the top left pixels stretched over the sprite.

Quote:
On a sidenote, why aren't you using CG or HLSL? It's much more friendly to code with!
Old habbits I guess :) For simple shader I still find asm easier/faster to use. Even though my engine/material language has support for HLSL.

Share this post


Link to post
Share on other sites
Bah! I forgot to set the D3DRS_POINTSPRITEENABLE to TRUE :)
I somehow thought that the render states only applied to the T&L pipeline, but:

Quote:

BOOL value. When TRUE, texture coordinates of point primitives are set so that full textures are mapped on each point. When FALSE, the vertex texture coordinates are used for the entire point. The default value is FALSE. You can achieve Microsoft DirectX 7.0 style single-pixel points by setting D3DRS_POINTSCALEENABLE to FALSE and D3DRS_POINTSIZE to 1.0, which are the default values.



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!