53 #include <QtGui/private/qshader_p.h>
62 const bool MRT =
false;
64 #include "../shared/cube.h"
75 static const QSize OFFSCREEN_SIZE(512, 512);
147 { 3 *
sizeof(float) },
148 { 2 *
sizeof(float) }
167 desc.setDepthTexture(m_depthTex);
173 desc.setDepthStencilBuffer(m_ds);
189 m_offscreenTriangle.
setRhi(m_r);
201 m_offscreenTriangle.
resize(pixelSize);
224 m_depthTex =
nullptr;
255 mvp.
rotate(m_rotation, 1, 0, 0);
271 u->uploadTexture(m_tex, m_image);
283 cb->setGraphicsPipeline(m_ps);
285 cb->setShaderResources();
288 { m_vbuf,
quint32(36 * 3 *
sizeof(
float)) }
290 cb->setVertexInput(0, 2, vbufBindings);
small capitals from c petite p scientific f u
static QColor fromRgbF(float r, float g, float b, float a=1.0)
The QFile class provides an interface for reading from and writing to files.
The QImage class provides a hardware-independent image representation that allows direct access to th...
QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
QImage mirrored(bool horizontally=false, bool vertically=true) const &
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
void rotate(float angle, const QVector3D &vector)
void scale(const QVector3D &vector)
void perspective(float verticalAngle, float aspectRatio, float nearPlane, float farPlane)
const float * constData() const
void translate(const QVector3D &vector)
QPair< QRhiBuffer *, quint32 > VertexInput
void setCullMode(CullMode mode)
void setFrontFace(FrontFace f)
void setDepthWrite(bool enable)
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
void setDepthOp(CompareOp op)
void setVertexInputLayout(const QRhiVertexInputLayout &layout)
void setShaderStages(std::initializer_list< QRhiShaderStage > list)
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
void setSampleCount(int s)
void setDepthTest(bool enable)
QMatrix4x4 clipSpaceCorrMatrix() const
bool isYUpInFramebuffer() const
QRhiShaderResourceBindings * newShaderResourceBindings()
QRhiRenderBuffer * newRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount=1, QRhiRenderBuffer::Flags flags={}, QRhiTexture::Format backingFormatHint=QRhiTexture::UnknownFormat)
QRhiBuffer * newBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
QRhiSampler * newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode addressU, QRhiSampler::AddressMode addressV, QRhiSampler::AddressMode addressW=QRhiSampler::Repeat)
QRhiTextureRenderTarget * newTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags={})
QRhiGraphicsPipeline * newGraphicsPipeline()
QRhiTexture * newTexture(QRhiTexture::Format format, const QSize &pixelSize, int sampleCount=1, QRhiTexture::Flags flags={})
QRhiResourceUpdateBatch * nextResourceUpdateBatch()
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
void setName(const QByteArray &name)
void uploadStaticBuffer(QRhiBuffer *buf, int offset, int size, const void *data)
void updateDynamicBuffer(QRhiBuffer *buf, int offset, int size, const void *data)
static QRhiShaderResourceBinding sampledTexture(int binding, StageFlags stage, QRhiTexture *tex, QRhiSampler *sampler)
static QRhiShaderResourceBinding uniformBuffer(int binding, StageFlags stage, QRhiBuffer *buf)
void setBindings(std::initializer_list< QRhiShaderResourceBinding > list)
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor()=0
static QShader fromSerialized(const QByteArray &data)
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
constexpr int width() const noexcept
The QString class provides a Unicode character string.
void queueOffscreenPass(QRhiCommandBuffer *cb)
void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels)
void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates)
void resize(const QSize &pixelSize)
void initResources(QRhiRenderPassDescriptor *rp)
void setColorAttCount(int count)
void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels)
void setDepthWrite(bool enable)
void releaseResources() override
void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates)
void initResources() override
void resize(const QSize &pixelSize)
QShader getShader(const QString &name)
#define QByteArrayLiteral(str)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
const bool IMAGE_UNDER_OFFSCREEN_RENDERING
const bool UPLOAD_UNDERLAY_ON_EVERY_FRAME